diff --git a/lib/gis/G.h b/lib/gis/G.h index 0cbfb5dbaaa..d2e31051797 100644 --- a/lib/gis/G.h +++ b/lib/gis/G.h @@ -1,6 +1,12 @@ #include #include +#ifdef GRASS_CMAKE_BUILD +#include +#else +#define GRASS_GIS_EXPORT +#endif + struct G__ /* Structure of library globals */ { struct Cell_head window; /* Contains the current window */ @@ -9,4 +15,4 @@ struct G__ /* Structure of library globals */ int compression_level; /* zlib compression level */ }; -extern struct G__ G__; /* allocated in gisinit */ +GRASS_GIS_EXPORT extern struct G__ G__; /* allocated in gisinit */ diff --git a/lib/gis/gisinit.c b/lib/gis/gisinit.c index 9ae04ac2f56..6cec20b7150 100644 --- a/lib/gis/gisinit.c +++ b/lib/gis/gisinit.c @@ -26,12 +26,15 @@ #include "G.h" #include "gis_local_proto.h" +#if 0 #ifdef GRASS_CMAKE_BUILD #include #else #define GRASS_GIS_EXPORT #endif -struct G__ G__; +#endif + +GRASS_GIS_EXPORT struct G__ G__; /** initialized is set to 1 when engine is initialized */ /* GRASS_GIS_EXPORT static int initialized on windows msvc throws below error.