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.

1 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

cBduxjYmILmBisRG1VIvmD@wSEe... 12 Jan 21:14
  libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions Michael Natterer 12 Jan 21:13
Michael Natterer
2017-01-12 21:13:56 UTC (about 7 years ago)

libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions

On Thu, 2017-01-12 at 21:57 +0100, Helmut Jarausch wrote:

On 01/12/2017 08:58:11 PM, Michael Natterer wrote:

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

I've attached the log.

gimpbase-private.c  includes unconditionally

#include "config.h"

#include

#include "gimpbasetypes.h"

#include "gimpbase-private.h" #include "gimpcompatenums.h"

Here the first non-comment lines of gimpbasetypes.h

#ifndef __GIMP_BASE_TYPES_H__ #define __GIMP_BASE_TYPES_H__

#include #include

#include
#include

And here the first lines of gimpcompatenums.h

#ifndef __GIMP_COMPAT_ENUMS_H__ #define __GIMP_COMPAT_ENUMS_H__

G_BEGIN_DECLS

/*  These enums exist only for compatibility, their nicks are needed   *  for config file parsing; they are registered in gimp_base_init().
  */

#define GIMP_TYPE_ADD_MASK_TYPE_COMPAT   (gimp_add_mask_type_compat_get_type ())

GType gimp_add_mask_type_compat_get_type (void) G_GNUC_CONST;

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;

In bothes cases I don't see any conditional compilation which precludes  
the double definitions.

In gimpbaseenums.h there clearly is #ifndef GIMP_DISABLE_DEPRECATED that protects GIMP_ADD_WHITE_MASK and the other compat values from being visible if it's defined.

In your build log there is -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE which are part of CPPFLAGS as assembled in configure.ac. A few lines above adding -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE it adds -DGIMP_DISABLE_DEPRECATED, also unconditionally.

You probably changed your configure.ac, I have no other explanation how -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE but NOT -DGIMP_DISABLE_DEPRECATED end up on your compiler command line.

Please have a look at your configure.ac:

CPPFLAGS="${CPPFLAGS} -DGIMP_DISABLE_DEPRECATED -DBABL_DISABLE_DEPRECATED -DGSEAL_ENABLE"

and a few lines below:

CPPFLAGS="${CPPFLAGS} -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"

I have no explanation why the latter but not the former would make it to your compiler command line.

Please double check your source tree and maybe environment variables.

Regards, Mitch