Skip to content

Commit

Permalink
dllexport solv_version as well
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Apr 25, 2020
1 parent a066859 commit a5b7e68
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 24 deletions.
8 changes: 4 additions & 4 deletions src/solvversion.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
15 changes: 11 additions & 4 deletions src/solvversion.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion win32/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/win32)

SET (WIN32_COMPAT_SOURCES
${PROJECT_SOURCE_DIR}/win32/fnmatch.c
${PROJECT_SOURCE_DIR}/win32/getopt.c
${PROJECT_SOURCE_DIR}/win32/regcomp.c
${PROJECT_SOURCE_DIR}/win32/regexec.c
${PROJECT_SOURCE_DIR}/win32/strfncs.c
${PROJECT_SOURCE_DIR}/win32/tre-mem.c
)
)

INSTALL (FILES ${PROJECT_SOURCE_DIR}/win32/win32_config.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/solv")
13 changes: 0 additions & 13 deletions win32/config.h

This file was deleted.

2 changes: 1 addition & 1 deletion win32/getopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <stdlib.h>
#include <stdio.h>

#include "config.h"
#include "win32_config.h"

SOLV_API char *optarg;
SOLV_API int optind=1, opterr=1, optopt, __optpos, __optreset=0;
Expand Down
2 changes: 1 addition & 1 deletion win32/getopt.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
extern "C" {
#endif

#include "config.h"
#include "win32_config.h"

int getopt(int, char * const [], const char *);

Expand Down

0 comments on commit a5b7e68

Please sign in to comment.