Skip to content

Commit

Permalink
winpr: add WINPR_DLL definition
Browse files Browse the repository at this point in the history
  • Loading branch information
awakecoding committed Oct 4, 2018
1 parent 8871d55 commit 1b42e51
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,10 @@ else()
set(PRIVATE_KEYWORD "PRIVATE")
endif()

if(BUILD_SHARED_LIBS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWINPR_DLL")
endif()

add_subdirectory(winpr)

# Sub-directories
Expand Down
4 changes: 4 additions & 0 deletions winpr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ if(NOT DEFINED BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS ON)
endif()

if(BUILD_SHARED_LIBS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWINPR_DLL")
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWINPR_EXPORTS")

# Enable 64bit file support on linux and FreeBSD.
Expand Down
4 changes: 4 additions & 0 deletions winpr/include/winpr/winpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include <winpr/platform.h>

#ifdef WINPR_DLL
#if defined _WIN32 || defined __CYGWIN__
#ifdef WINPR_EXPORTS
#ifdef __GNUC__
Expand All @@ -42,6 +43,9 @@
#define WINPR_API
#endif
#endif
#else /* WINPR_DLL */
#define WINPR_API
#endif

/* Thread local storage keyword define */
#if defined _WIN32 || defined __CYGWIN__
Expand Down

0 comments on commit 1b42e51

Please sign in to comment.