RSS/Atom feed Twitter
Site is read-only, email is disabled

libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions Helmut Jarausch 12 Jan 17:14
  libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions Michael Natterer 12 Jan 18:01
   libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions Helmut Jarausch 12 Jan 19:16
    libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions Michael Natterer 12 Jan 19:58
Helmut Jarausch
2017-01-12 17:14:30 UTC (over 7 years ago)

libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions

Hi, I cannot compile the GIT version (today 16:00 GMT) Both, gimpbaseenums.h and gimpcompatenums.h define several enums of the same name.
This is on Gentoo, gcc-6.3.0

Thanks for looking into it, Helmut.

Here are a few lines from the error log:

In file included from gimpbase-private.c:29:0: gimpcompatenums.h:36:3: error: redeclaration of enumerator 'GIMP_ADD_WHITE_MASK'
GIMP_ADD_WHITE_MASK = GIMP_ADD_MASK_WHITE, ^~~~~~~~~~~~~~~~~~~
In file included from gimpbasetypes.h:26:0, from gimpbase-private.c:26: ../libgimpbase/gimpbaseenums.h:52:3: note: previous definition of 'GIMP_ADD_WHITE_MASK' was here
GIMP_ADD_WHITE_MASK = GIMP_ADD_MASK_WHITE, /*< skip, pdb-skip >*/
^~~~~~~~~~~~~~~~~~~
In file included from gimpbase-private.c:29:0: gimpcompatenums.h:37:3: error: redeclaration of enumerator 'GIMP_ADD_BLACK_MASK'
GIMP_ADD_BLACK_MASK = GIMP_ADD_MASK_BLACK, ^~~~~~~~~~~~~~~~~~~
In file included from gimpbasetypes.h:26:0, from gimpbase-private.c:26: ../libgimpbase/gimpbaseenums.h:53:3: note: previous definition of 'GIMP_ADD_BLACK_MASK' was here
GIMP_ADD_BLACK_MASK = GIMP_ADD_MASK_BLACK, /*< skip, pdb-skip >*/
^~~~~~~~~~~~~~~~~~~
In file included from gimpbase-private.c:29:0: gimpcompatenums.h:38:3: error: redeclaration of enumerator 'GIMP_ADD_ALPHA_MASK'
GIMP_ADD_ALPHA_MASK = GIMP_ADD_MASK_ALPHA, ^~~~~~~~~~~~~~~~~~~
In file included from gimpbasetypes.h:26:0, from gimpbase-private.c:26: ../libgimpbase/gimpbaseenums.h:54:3: note: previous definition of 'GIMP_ADD_ALPHA_MASK' was here
GIMP_ADD_ALPHA_MASK = GIMP_ADD_MASK_ALPHA, /*< skip, pdb-skip >*/
^~~~~~~~~~~~~~~~~~~
In file included from gimpbase-private.c:29:0: gimpcompatenums.h:39:3: error: redeclaration of enumerator 'GIMP_ADD_ALPHA_TRANSFER_MASK'
GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from gimpbasetypes.h:26:0, from gimpbase-private.c:26: ../libgimpbase/gimpbaseenums.h:55:3: note: previous definition of 'GIMP_ADD_ALPHA_TRANSFER_MASK' was here GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER, /*< skip, pdb-skip >*/
^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Michael Natterer
2017-01-12 18:01:14 UTC (over 7 years ago)

libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions

On Thu, 2017-01-12 at 18:14 +0100, Helmut Jarausch wrote:

Hi, I cannot compile the GIT version (today 16:00 GMT) Both, gimpbaseenums.h  and gimpcompatenums.h define several enums of  
the same name.
This is on Gentoo, gcc-6.3.0

This shouldn't happen, the resp. values in gimpbaseenums.h are protected by #ifndef GIMP_DISABLE_DEPRECATED and that is always defined when building GIMP.

Did you somehow undefine it?

Regards, Mitch

Thanks for looking into it,
Helmut.

Here are a few lines from the error log:

In file included from gimpbase-private.c:29:0: gimpcompatenums.h:36:3: error: redeclaration of enumerator   'GIMP_ADD_WHITE_MASK'
    GIMP_ADD_WHITE_MASK          = GIMP_ADD_MASK_WHITE,     ^~~~~~~~~~~~~~~~~~~
In file included from gimpbasetypes.h:26:0,                   from gimpbase-private.c:26: ../libgimpbase/gimpbaseenums.h:52:3: note: previous definition of   'GIMP_ADD_WHITE_MASK' was here
    GIMP_ADD_WHITE_MASK          = GIMP_ADD_MASK_WHITE,     /*< skip,  
pdb-skip >*/
    ^~~~~~~~~~~~~~~~~~~
In file included from gimpbase-private.c:29:0: gimpcompatenums.h:37:3: error: redeclaration of enumerator   'GIMP_ADD_BLACK_MASK'
    GIMP_ADD_BLACK_MASK          = GIMP_ADD_MASK_BLACK,     ^~~~~~~~~~~~~~~~~~~
In file included from gimpbasetypes.h:26:0,                   from gimpbase-private.c:26: ../libgimpbase/gimpbaseenums.h:53:3: note: previous definition of   'GIMP_ADD_BLACK_MASK' was here
    GIMP_ADD_BLACK_MASK          = GIMP_ADD_MASK_BLACK,     /*< skip,  
pdb-skip >*/
    ^~~~~~~~~~~~~~~~~~~
In file included from gimpbase-private.c:29:0: gimpcompatenums.h:38:3: error: redeclaration of enumerator   'GIMP_ADD_ALPHA_MASK'
    GIMP_ADD_ALPHA_MASK          = GIMP_ADD_MASK_ALPHA,     ^~~~~~~~~~~~~~~~~~~
In file included from gimpbasetypes.h:26:0,                   from gimpbase-private.c:26: ../libgimpbase/gimpbaseenums.h:54:3: note: previous definition of   'GIMP_ADD_ALPHA_MASK' was here
    GIMP_ADD_ALPHA_MASK          = GIMP_ADD_MASK_ALPHA,     /*< skip,  
pdb-skip >*/
    ^~~~~~~~~~~~~~~~~~~
In file included from gimpbase-private.c:29:0: gimpcompatenums.h:39:3: error: redeclaration of enumerator   'GIMP_ADD_ALPHA_TRANSFER_MASK'
    GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER,     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from gimpbasetypes.h:26:0,                   from gimpbase-private.c:26: ../libgimpbase/gimpbaseenums.h:55:3: note: previous definition of   'GIMP_ADD_ALPHA_TRANSFER_MASK' was here     GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER, /**/
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________ gimp-developer-list mailing list
List address:    gimp-developer-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-develop er-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list

Helmut Jarausch
2017-01-12 19:16:28 UTC (over 7 years ago)

libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions

On 01/12/2017 07:01:14 PM, Michael Natterer wrote:

On Thu, 2017-01-12 at 18:14 +0100, Helmut Jarausch wrote:

Hi, I cannot compile the GIT version (today 16:00 GMT) Both, gimpbaseenums.hand gimpcompatenums.h define several enums of
the same name.
This is on Gentoo, gcc-6.3.0

This shouldn't happen, the resp. values in gimpbaseenums.h are protected by #ifndef GIMP_DISABLE_DEPRECATED and that is always defined when building GIMP.

Did you somehow undefine it?

Regards, Mitch

Not intentionally, at least.

File gimpbase-private.c unconditionally includes

gimpbasetypes.h which includes gimpbaseenums.h and
gimpcompatenums.h

both, gimpbaseenums.h and gimpcompatenums.h declare uncondtionally

typedef enum {
GIMP_ADD_WHITE_MASK = GIMP_ADD_MASK_WHITE, GIMP_ADD_BLACK_MASK = GIMP_ADD_MASK_BLACK, GIMP_ADD_ALPHA_MASK = GIMP_ADD_MASK_ALPHA, GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER, GIMP_ADD_SELECTION_MASK = GIMP_ADD_MASK_SELECTION, GIMP_ADD_COPY_MASK = GIMP_ADD_MASK_COPY, GIMP_ADD_CHANNEL_MASK = GIMP_ADD_MASK_CHANNEL } GimpAddMaskTypeCompat;

and
typedef enum
{
GIMP_ADD_MASK_WHITE, /*< desc="_White (full opacity)" >*/
GIMP_ADD_MASK_BLACK, /*< desc="_Black (full transparency)" >*/
GIMP_ADD_MASK_ALPHA, /*< desc="Layer's _alpha channel" >*/
GIMP_ADD_MASK_ALPHA_TRANSFER, /*< desc="_Transfer layer's alpha channel" >*/
GIMP_ADD_MASK_SELECTION, /*< desc="_Selection" >*/ GIMP_ADD_MASK_COPY, /*< desc="_Grayscale copy of layer" >*/
GIMP_ADD_MASK_CHANNEL, /*< desc="C_hannel" >*/

#ifndef GIMP_DISABLE_DEPRECATED GIMP_ADD_WHITE_MASK = GIMP_ADD_MASK_WHITE, /*< skip, pdb-skip >*/
GIMP_ADD_BLACK_MASK = GIMP_ADD_MASK_BLACK, /*< skip, pdb-skip >*/
GIMP_ADD_ALPHA_MASK = GIMP_ADD_MASK_ALPHA, /*< skip, pdb-skip >*/
GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER, /*< skip, pdb-skip >*/
GIMP_ADD_SELECTION_MASK = GIMP_ADD_MASK_SELECTION, /*< skip, pdb-skip >*/
GIMP_ADD_COPY_MASK = GIMP_ADD_MASK_COPY, /*< skip, pdb-skip >*/
GIMP_ADD_CHANNEL_MASK = GIMP_ADD_MASK_CHANNEL /*< skip, pdb-skip >*/
#endif /* GIMP_DISABLE_DEPRECATED */ } GimpAddMaskType;

such that GIMP_ADD_MASK_WHITE is declared twice, indeed.

Michael Natterer
2017-01-12 19:58:11 UTC (over 7 years ago)

libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions

On Thu, 2017-01-12 at 20:16 +0100, Helmut Jarausch wrote:

On 01/12/2017 07:01:14 PM, Michael Natterer wrote:

On Thu, 2017-01-12 at 18:14 +0100, Helmut Jarausch wrote:

Hi, I cannot compile the GIT version (today 16:00 GMT) Both, gimpbaseenums.h  and gimpcompatenums.h define several enums of  
the same name.
This is on Gentoo, gcc-6.3.0

This shouldn't happen, the resp. values in gimpbaseenums.h are protected by #ifndef GIMP_DISABLE_DEPRECATED and that is always defined when building GIMP.

Did you somehow undefine it?

Regards, Mitch

Not intentionally, at least.

File gimpbase-private.c unconditionally includes

gimpbasetypes.h  which includes gimpbaseenums.h and
gimpcompatenums.h

both, gimpbaseenums.h and gimpcompatenums.h declare uncondtionally

typedef enum {
   GIMP_ADD_WHITE_MASK          = GIMP_ADD_MASK_WHITE,    GIMP_ADD_BLACK_MASK          = GIMP_ADD_MASK_BLACK,    GIMP_ADD_ALPHA_MASK          = GIMP_ADD_MASK_ALPHA,    GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER,    GIMP_ADD_SELECTION_MASK      = GIMP_ADD_MASK_SELECTION,    GIMP_ADD_COPY_MASK           = GIMP_ADD_MASK_COPY,    GIMP_ADD_CHANNEL_MASK        = GIMP_ADD_MASK_CHANNEL } GimpAddMaskTypeCompat;

and
typedef enum
{
   GIMP_ADD_MASK_WHITE,          /*< desc="_White (full   opacity)"           >*/
   GIMP_ADD_MASK_BLACK,          /*< desc="_Black (full   transparency)"      >*/
   GIMP_ADD_MASK_ALPHA,          /*< desc="Layer's _alpha   channel"          >*/
   GIMP_ADD_MASK_ALPHA_TRANSFER, /*< desc="_Transfer layer's alpha   channel" >*/
   GIMP_ADD_MASK_SELECTION,      /**/    GIMP_ADD_MASK_COPY,           /*< desc="_Grayscale copy of   layer"        >*/
   GIMP_ADD_MASK_CHANNEL,        /**/

#ifndef GIMP_DISABLE_DEPRECATED    GIMP_ADD_WHITE_MASK          = GIMP_ADD_MASK_WHITE,     /*< skip,  
pdb-skip >*/
   GIMP_ADD_BLACK_MASK          = GIMP_ADD_MASK_BLACK,     /*< skip,  
pdb-skip >*/
   GIMP_ADD_ALPHA_MASK          = GIMP_ADD_MASK_ALPHA,     /*< skip,  
pdb-skip >*/
   GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER, /**/    GIMP_ADD_SELECTION_MASK      = GIMP_ADD_MASK_SELECTION, /*< skip,  
pdb-skip >*/
   GIMP_ADD_COPY_MASK           = GIMP_ADD_MASK_COPY,      /*< skip,  
pdb-skip >*/
   GIMP_ADD_CHANNEL_MASK        = GIMP_ADD_MASK_CHANNEL    /*< skip,  
pdb-skip >*/
#endif /* GIMP_DISABLE_DEPRECATED */ } GimpAddMaskType;

such that  GIMP_ADD_MASK_WHITE is declared twice, indeed.

It's only declared twice if GIMP_DISABLE_DEPRECATED is *not* defined. Can you paste the output of "make V=1" of gimpbase-private.c please?

Regards, Mitch