[gimp/meson: 120/127] Fix: Rename DATADIR as GIMPDATADIR, as it conflicts with Mingw headers.
- From: Félix Piédallu <fpiedallu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/meson: 120/127] Fix: Rename DATADIR as GIMPDATADIR, as it conflicts with Mingw headers.
- Date: Fri, 2 Feb 2018 16:09:51 +0000 (UTC)
commit 6771cdb4aa47b06cbcb57b177aa745f1992f71ad
Author: Félix Piédallu <felix piedallu me>
Date: Tue Jan 30 17:27:43 2018 +0100
Fix: Rename DATADIR as GIMPDATADIR, as it conflicts with Mingw headers.
app/config/Makefile.am | 2 +-
libgimpbase/Makefile.am | 2 +-
libgimpbase/gimpenv.c | 10 ++--------
libgimpbase/gimputils.c | 9 ++-------
meson.build | 2 +-
plug-ins/help/Makefile.am | 2 +-
6 files changed, 8 insertions(+), 19 deletions(-)
---
diff --git a/app/config/Makefile.am b/app/config/Makefile.am
index 7780250..a0f3efe 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 ac600fe..3c54276 100644
--- a/libgimpbase/Makefile.am
+++ b/libgimpbase/Makefile.am
@@ -49,7 +49,7 @@ libgimpbaseincludedir = $(includedir)/gimp-$(GIMP_API_VERSION)/libgimpbase
AM_CPPFLAGS = \
-DPREFIX=\""$(prefix)"\" \
-DGIMPDIR=\""$(gimpdir)"\" \
- -DDATADIR=\""$(gimpdatadir)"\" \
+ -DGIMPDATADIR=\""$(gimpdatadir)"\" \
-DLOCALEDIR=\""$(gimplocaledir)"\" \
-DPLUGINDIR=\""$(gimpplugindir)"\" \
-DGIMPSYSCONFDIR=\""$(gimpsysconfdir)"\" \
diff --git a/libgimpbase/gimpenv.c b/libgimpbase/gimpenv.c
index 5777c2b..200e69a 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
@@ -485,7 +479,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);
}
diff --git a/libgimpbase/gimputils.c b/libgimpbase/gimputils.c
index 07990c8..a65429f 100644
--- a/libgimpbase/gimputils.c
+++ b/libgimpbase/gimputils.c
@@ -31,13 +31,8 @@
#include <gio/gio.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>
#endif
#include "gimpbasetypes.h"
diff --git a/meson.build b/meson.build
index b62cb55..ed4eb8c 100644
--- a/meson.build
+++ b/meson.build
@@ -796,11 +796,11 @@ config_defines = [
'-DEXEC_PREFIX=' +'"'+ prefix +'"',
'-DGIMPDIR=' +'"'+ gimpdir +'"',
'-DGIMPSYSCONFDIR=' +'"'+ gimpsysconfdir +'"',
- '-DDATADIR=' +'"'+ join_paths(prefix, gimpdatadir) +'"',
'-DGIMPDATADIR=' +'"'+ join_paths(prefix, gimpdatadir) +'"',
'-DGIMPPLUGINDIR=' +'"'+ join_paths(prefix, gimpplugindir) +'"',
'-DPLUGINDIR=' +'"'+ join_paths(prefix, gimpplugindir) +'"',
'-DLOCALEDIR=' +'"'+ join_paths(prefix, localedir) +'"',
+
'-DLOCALSTATEDIR=' +'"'+ get_option('localstatedir') +'"',
'-DSHAREDSTATEDIR=' +'"'+ get_option('sharedstatedir') +'"', # HUH ? /usr/com
'-DSYSCONFDIR=' +'"'+ get_option('sysconfdir') +'"',
diff --git a/plug-ins/help/Makefile.am b/plug-ins/help/Makefile.am
index 8457c33..0b252a5 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) \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]