diff --git a/src/solvversion.c b/src/solvversion.c index d66e19589..7124c93e0 100644 --- a/src/solvversion.c +++ b/src/solvversion.c @@ -7,7 +7,7 @@ #include "solvversion.h" -const char solv_version[] = LIBSOLV_VERSION_STRING; -int solv_version_major = LIBSOLV_VERSION_MAJOR; -int solv_version_minor = LIBSOLV_VERSION_MINOR; -int solv_version_patch = LIBSOLV_VERSION_PATCH; +SOLV_API const char solv_version[] = LIBSOLV_VERSION_STRING; +SOLV_API int solv_version_major = LIBSOLV_VERSION_MAJOR; +SOLV_API int solv_version_minor = LIBSOLV_VERSION_MINOR; +SOLV_API int solv_version_patch = LIBSOLV_VERSION_PATCH; diff --git a/src/solvversion.h.in b/src/solvversion.h.in index 43b566a11..7b53b83db 100644 --- a/src/solvversion.h.in +++ b/src/solvversion.h.in @@ -19,10 +19,17 @@ #define LIBSOLV_VERSION_PATCH @LIBSOLV_PATCH@ #define LIBSOLV_VERSION (LIBSOLV_VERSION_MAJOR * 10000 + LIBSOLV_VERSION_MINOR * 100 + LIBSOLV_VERSION_PATCH) -extern const char solv_version[]; -extern int solv_version_major; -extern int solv_version_minor; -extern int solv_version_patch; +#ifdef _WIN32 +// include win32/config.h for SOLV_API +#include "win32_config.h" +#else +#define SOLV_API +#endif + +SOLV_API extern const char solv_version[]; +SOLV_API extern int solv_version_major; +SOLV_API extern int solv_version_minor; +SOLV_API extern int solv_version_patch; #cmakedefine LIBSOLV_FEATURE_LINKED_PKGS #cmakedefine LIBSOLV_FEATURE_COMPLEX_DEPS diff --git a/win32/CMakeLists.txt b/win32/CMakeLists.txt index 9a87af7bf..d34a713e4 100644 --- a/win32/CMakeLists.txt +++ b/win32/CMakeLists.txt @@ -1,4 +1,5 @@ INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/win32) + SET (WIN32_COMPAT_SOURCES ${PROJECT_SOURCE_DIR}/win32/fnmatch.c ${PROJECT_SOURCE_DIR}/win32/getopt.c @@ -6,4 +7,6 @@ SET (WIN32_COMPAT_SOURCES ${PROJECT_SOURCE_DIR}/win32/regexec.c ${PROJECT_SOURCE_DIR}/win32/strfncs.c ${PROJECT_SOURCE_DIR}/win32/tre-mem.c -) \ No newline at end of file +) + +INSTALL (FILES ${PROJECT_SOURCE_DIR}/win32/win32_config.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/solv") \ No newline at end of file diff --git a/win32/config.h b/win32/config.h deleted file mode 100644 index 68eca6340..000000000 --- a/win32/config.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifdef _WIN32 - #ifdef SOLV_STATIC_LIB - #define SOLV_API - #else - #ifdef SOLV_EXPORTS - #define SOLV_API __declspec(dllexport) - #else - #define SOLV_API __declspec(dllimport) - #endif - #endif -#else - #define SOLV_API -#endif \ No newline at end of file diff --git a/win32/getopt.c b/win32/getopt.c index c4fc96432..f4a13e37f 100644 --- a/win32/getopt.c +++ b/win32/getopt.c @@ -5,7 +5,7 @@ #include #include -#include "config.h" +#include "win32_config.h" SOLV_API char *optarg; SOLV_API int optind=1, opterr=1, optopt, __optpos, __optreset=0; diff --git a/win32/getopt.h b/win32/getopt.h index 861ff0b39..a66d98e98 100644 --- a/win32/getopt.h +++ b/win32/getopt.h @@ -5,7 +5,7 @@ extern "C" { #endif -#include "config.h" +#include "win32_config.h" int getopt(int, char * const [], const char *);