Browse Source

To avoid target exe file export JSON functions.

tags/json-c-0.16-20220414
ssrlive 4 years ago
parent
commit
ba181548bc
5 changed files with 8 additions and 4 deletions
  1. +4
    -0
      CMakeLists.txt
  2. +1
    -1
      debug.h
  3. +1
    -1
      json_c_version.h
  4. +1
    -1
      json_types.h
  5. +1
    -1
      printbuf.h

+ 4
- 0
CMakeLists.txt View File

@@ -79,6 +79,10 @@ include(CMakePackageConfigHelpers)
option(BUILD_SHARED_LIBS "Default to building shared libraries" ON) option(BUILD_SHARED_LIBS "Default to building shared libraries" ON)
option(BUILD_STATIC_LIBS "Default to building static libraries" ON) option(BUILD_STATIC_LIBS "Default to building static libraries" ON)


if (BUILD_SHARED_LIBS)
add_definitions(-D JSON_C_DLL)
endif()

# Generate a release merge and test it to verify the correctness of republishing the package. # Generate a release merge and test it to verify the correctness of republishing the package.
ADD_CUSTOM_TARGET(distcheck ADD_CUSTOM_TARGET(distcheck
COMMAND make package_source COMMAND make package_source


+ 1
- 1
debug.h View File

@@ -24,7 +24,7 @@ extern "C" {
#endif #endif


#ifndef JSON_EXPORT #ifndef JSON_EXPORT
#if defined(_MSC_VER)
#if defined(_MSC_VER) && defined(JSON_C_DLL)
#define JSON_EXPORT __declspec(dllexport) #define JSON_EXPORT __declspec(dllexport)
#else #else
#define JSON_EXPORT extern #define JSON_EXPORT extern


+ 1
- 1
json_c_version.h View File

@@ -24,7 +24,7 @@ extern "C" {
#define JSON_C_VERSION "0.15.99" #define JSON_C_VERSION "0.15.99"


#ifndef JSON_EXPORT #ifndef JSON_EXPORT
#if defined(_MSC_VER)
#if defined(_MSC_VER) && defined(JSON_C_DLL)
#define JSON_EXPORT __declspec(dllexport) #define JSON_EXPORT __declspec(dllexport)
#else #else
#define JSON_EXPORT extern #define JSON_EXPORT extern


+ 1
- 1
json_types.h View File

@@ -18,7 +18,7 @@ extern "C" {
#endif #endif


#ifndef JSON_EXPORT #ifndef JSON_EXPORT
#if defined(_MSC_VER)
#if defined(_MSC_VER) && defined(JSON_C_DLL)
#define JSON_EXPORT __declspec(dllexport) #define JSON_EXPORT __declspec(dllexport)
#else #else
#define JSON_EXPORT extern #define JSON_EXPORT extern


+ 1
- 1
printbuf.h View File

@@ -24,7 +24,7 @@
#define _printbuf_h_ #define _printbuf_h_


#ifndef JSON_EXPORT #ifndef JSON_EXPORT
#if defined(_MSC_VER)
#if defined(_MSC_VER) && defined(JSON_C_DLL)
#define JSON_EXPORT __declspec(dllexport) #define JSON_EXPORT __declspec(dllexport)
#else #else
#define JSON_EXPORT extern #define JSON_EXPORT extern


Loading…
Cancel
Save