diff --git a/include/json/autolink.h b/include/json/autolink.h deleted file mode 100644 index 5f04a55..0000000 --- a/include/json/autolink.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef JSON_AUTOLINK_H_INCLUDED -#define JSON_AUTOLINK_H_INCLUDED - -#include "config.h" - -#if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) -#define AUTOLINK_NAME "json" -#ifdef JSON_DLL -#define AUTOLINK_DLL -#endif -#include "autolink.h" -#endif - -#endif // JSON_AUTOLINK_H_INCLUDED diff --git a/include/json/config.h b/include/json/config.h index 2b4392c..0a3bc92 100644 --- a/include/json/config.h +++ b/include/json/config.h @@ -30,6 +30,22 @@ /// Remarks: it is automatically defined in the generated amalgamated header. // #define JSON_IS_AMALGAMATION +// Export macros for DLL visibility +#if defined(JSON_DLL_BUILD) +#if defined(_MSC_VER) || defined(__MINGW32__) +#define JSON_API __declspec(dllexport) +#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING +#elif defined(__GNUC__) || defined(__clang__) +#define JSON_API __attribute__((visibility("default"))) +#endif // if defined(_MSC_VER) + +#elif defined(JSON_DLL) +#if defined(_MSC_VER) || defined(__MINGW32__) +#define JSON_API __declspec(dllimport) +#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING +#endif // if defined(_MSC_VER) +#endif // ifdef JSON_DLL_BUILD + #if !defined(JSON_API) #define JSON_API #endif diff --git a/include/json/json.h b/include/json/json.h index f1b679a..5c776a1 100644 --- a/include/json/json.h +++ b/include/json/json.h @@ -6,7 +6,7 @@ #ifndef JSON_JSON_H_INCLUDED #define JSON_JSON_H_INCLUDED -#include "autolink.h" +#include "config.h" #include "json_features.h" #include "reader.h" #include "value.h" diff --git a/meson.build b/meson.build index 8531dce..1bc94a8 100644 --- a/meson.build +++ b/meson.build @@ -21,7 +21,6 @@ project( jsoncpp_headers = [ 'include/json/allocator.h', 'include/json/assertions.h', - 'include/json/autolink.h', 'include/json/config.h', 'include/json/json_features.h', 'include/json/forwards.h',