1
0
forked from GitHub/gf-core

a patch from Bjørnar Luteberget for compatibility with MSVC

This commit is contained in:
krasimir
2017-04-12 10:24:56 +00:00
parent 915747efa7
commit a8eaa2f2e5
17 changed files with 72 additions and 28 deletions

View File

@@ -25,6 +25,24 @@
#ifndef GU_DEFS_H_
#define GU_DEFS_H_
// MSVC requires explicit export/import of
// symbols in DLLs. CMake takes care of this
// for functions, but not for data/variables.
#if defined(_MSC_VER)
#if defined(COMPILING_GU)
#define GU_API_DATA_DECL __declspec(dllexport)
#define GU_API_DATA __declspec(dllexport)
#else
#define GU_API_DATA_DECL __declspec(dllimport)
#define GU_API_DATA ERROR_NOT_COMPILING_LIBGU
#endif
#else
#define GU_API_DATA_DECL extern
#define GU_API_DATA
#endif
// end MSVC workaround
#include <stddef.h>
#include <inttypes.h>
#include <stdbool.h>
@@ -154,7 +172,7 @@ extern void* const gu_null;
// Dummy struct used for generic struct pointers
typedef struct GuStruct GuStruct;
extern GuStruct* const gu_null_struct;
GU_API_DATA_DECL GuStruct* const gu_null_struct;
typedef uintptr_t GuWord;