Skip to content

Commit

Permalink
windows build fix (zerotier#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexIndustrial committed Feb 2, 2024
1 parent 7fa5968 commit c16f1b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ include_directories(${ZTO_SRC_DIR}/osdep)
include_directories(${ZTO_SRC_DIR}/ext/libnatpmp)
include_directories(${ZTO_SRC_DIR}/ext/prometheus-cpp-lite-1.0/core/include)
include_directories(${ZTO_SRC_DIR}/ext/prometheus-cpp-lite-1.0/simpleapi/include)
include_directories(${ZTO_SRC_DIR}/ext/)
# libzt
include_directories(${PROJ_DIR}/src)
include_directories(${PROJ_DIR}/include)
Expand Down
22 changes: 13 additions & 9 deletions include/ZeroTierSockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ typedef enum {
/**
* Error variable set after each `zts_*` socket call. Provides additional error context.
*/
extern int zts_errno;
extern ZTS_API int zts_errno;

typedef enum {
/** Operation not permitted */
Expand Down Expand Up @@ -1011,15 +1011,19 @@ typedef struct {
//----------------------------------------------------------------------------//

#if defined(_WIN32)
#ifdef ADD_EXPORTS
#define ZTS_API __declspec(dllexport)
#ifndef ZTS_STATIC
#ifdef ADD_EXPORTS
#define ZTS_API __declspec(dllexport)
#else
#define ZTS_API __declspec(dllimport)
#endif
#else
#define ZTS_API
#endif
#define ZTCALL __cdecl
#else
#define ZTS_API __declspec(dllimport)
#endif
#define ZTCALL __cdecl
#else
#define ZTS_API
#define ZTCALL
#define ZTS_API
#define ZTCALL
#endif

//----------------------------------------------------------------------------//
Expand Down

0 comments on commit c16f1b4

Please sign in to comment.