summaryrefslogtreecommitdiffstats
path: root/src/path-prefix.h
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-03-30 19:53:42 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-03-30 20:47:00 +0000
commit57b146853fad8497bd8d3b8dce38c14f11f46e48 (patch)
tree2db1c05d5730fa149e6fcf1b185999b4e0bffc64 /src/path-prefix.h
parentInkscape::IO::Resource: Drop "DATA_DIR" from Type enum (diff)
downloadinkscape-57b146853fad8497bd8d3b8dce38c14f11f46e48.tar.gz
inkscape-57b146853fad8497bd8d3b8dce38c14f11f46e48.zip
Avoid redefining INKSCAPE_DATADIR
Define and use INKSCAPE_DATADIR_REAL instead, which avoids potential include order issues and avoids some semantic ambiguity.
Diffstat (limited to 'src/path-prefix.h')
-rw-r--r--src/path-prefix.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/path-prefix.h b/src/path-prefix.h
index dd46d2cc4..adfa7f613 100644
--- a/src/path-prefix.h
+++ b/src/path-prefix.h
@@ -28,22 +28,13 @@
#include "prefix.h"
-
-char *append_inkscape_datadir(const char *relative_path);
-char *get_program_name();
-char *get_program_dir();
-
-#ifdef _WIN32
-#undef INKSCAPE_DATADIR
-#define INKSCAPE_DATADIR append_inkscape_datadir(NULL)
-#endif
-
#ifdef ENABLE_BINRELOC
/* The way that we're building now is with a shared library between Inkscape
and Inkview, and the code will find the path to the library then. But we
don't really want that. This prefix then pulls things out of the lib directory
and back into the root install dir. */
# define INKSCAPE_LIBPREFIX "/../.."
+# define INKSCAPE_DATADIR_REAL BR_DATADIR( INKSCAPE_LIBPREFIX "/share")
# define INKSCAPE_APPICONDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/pixmaps" )
# define INKSCAPE_ATTRRELDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/attributes" )
# define INKSCAPE_BINDDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/bind" )
@@ -71,6 +62,7 @@ char *get_program_dir();
# define CREATE_PATTERNSDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/create/patterns/vector" )
#else
# ifdef _WIN32
+# define INKSCAPE_DATADIR_REAL append_inkscape_datadir()
# define INKSCAPE_APPICONDIR append_inkscape_datadir("pixmaps")
# define INKSCAPE_ATTRRELDIR append_inkscape_datadir("attributes")
# define INKSCAPE_BINDDIR append_inkscape_datadir("bind")
@@ -96,7 +88,8 @@ char *get_program_dir();
# define CREATE_GRADIENTSDIR append_inkscape_datadir("create\\gradients\\gimp")
# define CREATE_PALETTESDIR append_inkscape_datadir("create\\swatches")
# define CREATE_PATTERNSDIR append_inkscape_datadir("create\\patterns\\vector")
-# elif defined ENABLE_OSX_APP_LOCATIONS
+# elif defined ENABLE_OSX_APP_LOCATIONS // TODO: Is ENABLE_OSX_APP_LOCATIONS still in use?
+# define INKSCAPE_DATADIR_REAL "Contents/Resources/share"
# define INKSCAPE_APPICONDIR "Contents/Resources/share/pixmaps"
# define INKSCAPE_ATTRRELDIR "Contents/Resources/share/inkscape/attributes"
# define INKSCAPE_BINDDIR "Contents/Resources/share/inkscape/bind"
@@ -123,6 +116,7 @@ char *get_program_dir();
# define CREATE_PALETTESDIR "/Library/Application Support/create/swatches"
# define CREATE_PATTERNSDIR "/Library/Application Support/create/patterns/vector"
# else
+# define INKSCAPE_DATADIR_REAL append_inkscape_datadir()
# define INKSCAPE_APPICONDIR append_inkscape_datadir("pixmaps")
# define INKSCAPE_ATTRRELDIR append_inkscape_datadir("inkscape/attributes")
# define INKSCAPE_BINDDIR append_inkscape_datadir("inkscape/bind")
@@ -151,4 +145,10 @@ char *get_program_dir();
# endif
#endif
+
+char *append_inkscape_datadir(const char *relative_path=nullptr);
+char *get_program_name();
+char *get_program_dir();
+
+
#endif /* _PATH_PREFIX_H_ */