diff options
author | past-due <30942300+past-due@users.noreply.github.com> | 2018-04-29 21:37:12 -0400 |
---|---|---|
committer | Steven G. Johnson <stevenj@mit.edu> | 2018-04-29 21:37:12 -0400 |
commit | 48949bd3ebd66bb94a40f4c3fcfb26dd4bf2be2b (patch) | |
tree | a134cb98c137196dac5fc013d244a844cae75e3a /utf8proc.h | |
parent | fe3f6bda1108655f1dc9356f151a1fec76517efa (diff) | |
download | libutf8proc-48949bd3ebd66bb94a40f4c3fcfb26dd4bf2be2b.tar.gz libutf8proc-48949bd3ebd66bb94a40f4c3fcfb26dd4bf2be2b.tar.bz2 |
Static library support improvements (#123)
* `#define UTF8PROC_STATIC` to disable DLLEXPORT
`#define UTF8PROC_STATIC` to disable DLLEXPORT
* [CMake] Automatically define UTF8PROC_STATIC if BUILD_SHARED_LIBS is off
* [Makefile] Support additional UTF8PROC_DEFINES, which can be used to specify flags like `-DUTF8PROC_STATIC`
Diffstat (limited to 'utf8proc.h')
-rw-r--r-- | utf8proc.h | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -120,16 +120,20 @@ typedef bool utf8proc_bool; #endif #include <limits.h> -#ifdef _WIN32 -# ifdef UTF8PROC_EXPORTS -# define UTF8PROC_DLLEXPORT __declspec(dllexport) +#ifdef UTF8PROC_STATIC +# define UTF8PROC_DLLEXPORT +#else +# ifdef _WIN32 +# ifdef UTF8PROC_EXPORTS +# define UTF8PROC_DLLEXPORT __declspec(dllexport) +# else +# define UTF8PROC_DLLEXPORT __declspec(dllimport) +# endif +# elif __GNUC__ >= 4 +# define UTF8PROC_DLLEXPORT __attribute__ ((visibility("default"))) # else -# define UTF8PROC_DLLEXPORT __declspec(dllimport) +# define UTF8PROC_DLLEXPORT # endif -#elif __GNUC__ >= 4 -# define UTF8PROC_DLLEXPORT __attribute__ ((visibility("default"))) -#else -# define UTF8PROC_DLLEXPORT #endif #ifdef __cplusplus |