From: swordow Date: Tue, 4 Jun 2019 01:55:03 +0000 (+0800) Subject: fix Static build extern X-Git-Tag: v6.9.3~75^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12287b7ea734788c62981c5e5fd8d2bd285308c4;p=onig fix Static build extern --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ac36cf1..ae26e28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,7 +75,7 @@ if(MSVC) $<$:/MT> $<$:/MTd> ) - target_compile_definitions(onig PUBLIC -DONIG_EXTERN=) + target_compile_definitions(onig PUBLIC -DONIG_STATIC) endif() elseif(CMAKE_COMPILER_IS_GNUCC) target_compile_options(onig PRIVATE diff --git a/src/oniguruma.h b/src/oniguruma.h index f6aa5ba..0462775 100644 --- a/src/oniguruma.h +++ b/src/oniguruma.h @@ -52,6 +52,7 @@ extern "C" { # define PV_(args) args #endif +#ifndef ONIG_STATIC #ifndef ONIG_EXTERN #if defined(_WIN32) && !defined(__GNUC__) #if defined(ONIGURUMA_EXPORT) @@ -65,6 +66,9 @@ extern "C" { #ifndef ONIG_EXTERN #define ONIG_EXTERN extern #endif +#else +#define ONIG_EXTERN extern +#endif /* PART: character encoding */