[gimp/gimp-2-10] (source modifs) Fix: Rename macros as it conflicts with Mingw headers. * DATADIR -> GIMPDATADIR * SY



commit 0436dd1cb768d6f38f952eb1ddc037567fbf54c2
Author: Félix Piédallu <felix piedallu me>
Date:   Tue Jan 30 17:27:43 2018 +0100

    (source modifs) Fix: Rename macros as it conflicts with Mingw headers.
    * DATADIR -> GIMPDATADIR
    * SYSCONFDIR -> GIMPSYSCONFDIR
    * DATADIR -> SYSDATADIR (tools/)
    
    (cherry picked from commit fc8303dd0a0efab10409303519c5605437dff14e)

 app/config/Makefile.am    |  2 +-
 libgimpbase/Makefile.am   |  4 ++--
 libgimpbase/gimpenv.c     | 12 +++---------
 libgimpbase/gimputils.c   | 10 ++--------
 plug-ins/help/Makefile.am |  2 +-
 tools/Makefile.am         |  2 +-
 tools/gimptool.c          |  2 +-
 7 files changed, 11 insertions(+), 23 deletions(-)
---
diff --git a/app/config/Makefile.am b/app/config/Makefile.am
index c3df49f3bc..3f7f395011 100644
--- a/app/config/Makefile.am
+++ b/app/config/Makefile.am
@@ -15,7 +15,7 @@ endif
 AM_CPPFLAGS = \
        -DG_LOG_DOMAIN=\"Gimp-Config\"                          \
        -DGIMP_APP_VERSION_STRING=\"$(GIMP_APP_VERSION)\"       \
-       -DDATADIR=\""$(datadir)"\"                              \
+       -DGIMPDATADIR=\""$(datadir)"\"                          \
        -I$(top_builddir)                                       \
        -I$(top_srcdir)                                         \
        -I$(top_builddir)/app                                   \
diff --git a/libgimpbase/Makefile.am b/libgimpbase/Makefile.am
index 2b735f9753..8642cc933e 100644
--- a/libgimpbase/Makefile.am
+++ b/libgimpbase/Makefile.am
@@ -51,10 +51,10 @@ libgimpbaseincludedir = $(includedir)/gimp-$(GIMP_API_VERSION)/libgimpbase
 AM_CPPFLAGS = \
        -DPREFIX=\""$(prefix)"\"                                \
        -DGIMPDIR=\""$(gimpdir)"\"                              \
-       -DDATADIR=\""$(gimpdatadir)"\"                          \
+       -DGIMPDATADIR=\""$(gimpdatadir)"\"                              \
        -DLOCALEDIR=\""$(gimplocaledir)"\"                      \
        -DPLUGINDIR=\""$(gimpplugindir)"\"                      \
-       -DSYSCONFDIR=\""$(gimpsysconfdir)"\"                    \
+       -DGIMPSYSCONFDIR=\""$(gimpsysconfdir)"\"                        \
        -DGIMP_PACKAGE=\""@PACKAGE@"\"                          \
        -DGIMP_DATA_VERSION=\"$(GIMP_DATA_VERSION)\"            \
        -DGIMP_USER_VERSION=\"$(GIMP_USER_VERSION)\"            \
diff --git a/libgimpbase/gimpenv.c b/libgimpbase/gimpenv.c
index cf476d51ba..46158739b3 100644
--- a/libgimpbase/gimpenv.c
+++ b/libgimpbase/gimpenv.c
@@ -65,14 +65,8 @@
 #define geteuid() 0
 #define getegid() 0
 
-/* This is a hack for Windows known directory support.
- * DATADIR (autotools-generated constant) is a type defined in objidl.h
- * so we must #undef it before including shlobj.h in order to avoid a
- * name clash. */
-static const char* datadir = DATADIR;
-#undef DATADIR
 #include <shlobj.h>
-#define DATADIR datadir
+
 /* Constant available since Shell32.dll 4.72 */
 #ifndef CSIDL_APPDATA
 #define CSIDL_APPDATA 0x001a
@@ -497,7 +491,7 @@ gimp_data_directory (void)
                                      GIMP_DATA_VERSION,
                                      NULL);
 
-      gimp_data_dir = gimp_env_get_dir ("GIMP2_DATADIR", DATADIR, tmp);
+      gimp_data_dir = gimp_env_get_dir ("GIMP2_DATADIR", GIMPDATADIR, tmp);
       g_free (tmp);
     }
 
@@ -584,7 +578,7 @@ gimp_sysconf_directory (void)
                                      GIMP_SYSCONF_VERSION,
                                      NULL);
 
-      gimp_sysconf_dir = gimp_env_get_dir ("GIMP2_SYSCONFDIR", SYSCONFDIR, tmp);
+      gimp_sysconf_dir = gimp_env_get_dir ("GIMP2_SYSCONFDIR", GIMPSYSCONFDIR, tmp);
       g_free (tmp);
     }
 
diff --git a/libgimpbase/gimputils.c b/libgimpbase/gimputils.c
index 08d91e0afa..2ee1338973 100644
--- a/libgimpbase/gimputils.c
+++ b/libgimpbase/gimputils.c
@@ -38,14 +38,8 @@
 #include <glib/gprintf.h>
 
 #if defined(G_OS_WIN32)
-
-/* This is a hack for Windows known directory support.
- * DATADIR (autotools-generated constant) is a type defined in objidl.h
- * so we must #undef it before including shlobj.h in order to avoid a
- * name clash. */
-#undef DATADIR
-#include <windows.h>
-#include <shlobj.h>
+# include <windows.h>
+# include <shlobj.h>
 
 #else /* G_OS_WIN32 */
 
diff --git a/plug-ins/help/Makefile.am b/plug-ins/help/Makefile.am
index dbc36108e6..a8823716b6 100644
--- a/plug-ins/help/Makefile.am
+++ b/plug-ins/help/Makefile.am
@@ -17,7 +17,7 @@ help_RC = help.rc.o
 endif
 
 AM_CPPFLAGS = \
-       -DDATADIR=\""$(gimpdatadir)"\"  \
+       -DGIMPDATADIR=\""$(gimpdatadir)"\"      \
        -I$(top_srcdir)                 \
        $(CAIRO_CFLAGS)                 \
        $(GIO_CFLAGS)                   \
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 574d072499..3d86a22176 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -73,7 +73,7 @@ AM_CPPFLAGS = \
        -DBINDIR=\""$(bindir)"\"                                \
        -DSBINDIR=\""$(sbindir)"\"                              \
        -DLIBEXECDIR=\""$(libexecdir)"\"                        \
-       -DDATADIR=\""$(datadir)"\"                              \
+       -DSYSDATADIR=\""$(datadir)"\"                           \
        -DDATAROOTDIR=\""$(datarootdir)"\"                      \
        -DSYSCONFDIR=\""$(sysconfdir)"\"                        \
        -DSHAREDSTATEDIR=\""$(sharedstatedir)"\"                \
diff --git a/tools/gimptool.c b/tools/gimptool.c
index 5705cabf35..24a40d8bd7 100644
--- a/tools/gimptool.c
+++ b/tools/gimptool.c
@@ -75,7 +75,7 @@ static struct {
   { "bindir",         BINDIR         },
   { "sbindir",        SBINDIR        },
   { "libexecdir",     LIBEXECDIR     },
-  { "datadir",        DATADIR        },
+  { "datadir",        SYSDATADIR     },
   { "datarootdir",    DATAROOTDIR    },
   { "sysconfdir",     SYSCONFDIR     },
   { "sharedstatedir", SHAREDSTATEDIR },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]