Issue #488: use JSON_EXPORT on functions so they are properly exported on Windows.

This commit is contained in:
Eric Haszlakiewicz
2019-09-08 22:42:36 -04:00
parent 374ffe87c6
commit eae040a84a
8 changed files with 57 additions and 31 deletions

View File

@@ -20,11 +20,19 @@
JSON_C_MICRO_VERSION)
#define JSON_C_VERSION "0.13.99"
#ifndef JSON_EXPORT
#if defined(_MSC_VER)
#define JSON_EXPORT __declspec(dllexport)
#else
#define JSON_EXPORT extern
#endif
#endif
/**
* @see JSON_C_VERSION
* @return the version of the json-c library as a string
*/
const char *json_c_version(void); /* Returns JSON_C_VERSION */
JSON_EXPORT const char *json_c_version(void); /* Returns JSON_C_VERSION */
/**
* The json-c version encoded into an int, with the low order 8 bits
@@ -35,6 +43,6 @@ const char *json_c_version(void); /* Returns JSON_C_VERSION */
* @see JSON_C_VERSION_NUM
* @return the version of the json-c library as an int
*/
int json_c_version_num(void); /* Returns JSON_C_VERSION_NUM */
JSON_EXPORT int json_c_version_num(void); /* Returns JSON_C_VERSION_NUM */
#endif