From 6cfc6bf4b8ab2206b40744835630488e21e34e73 Mon Sep 17 00:00:00 2001 From: owentou Date: Thu, 26 Nov 2020 19:43:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B7=B7=E5=90=88=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E9=83=A8=E5=88=86=E5=A4=B4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/config/compile_optimize.h | 38 ++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/include/config/compile_optimize.h b/include/config/compile_optimize.h index b5c0e84e..38741875 100644 --- a/include/config/compile_optimize.h +++ b/include/config/compile_optimize.h @@ -1,7 +1,4 @@ -#ifndef UTIL_CONFIG_COMPILE_OPTIMIZE_H -#define UTIL_CONFIG_COMPILE_OPTIMIZE_H - -#pragma once +#pragma once // ================ branch prediction information ================ @@ -58,22 +55,48 @@ // All Win32 development environments, including 64-bit Windows and MinGW, define // _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment, // so does not define _WIN32 or its variants. +#ifndef UTIL_SYMBOL_EXPORT #define UTIL_SYMBOL_EXPORT __attribute__((__dllexport__)) +#endif +#ifndef UTIL_SYMBOL_IMPORT #define UTIL_SYMBOL_IMPORT __attribute__((__dllimport__)) +#endif + #else + +#ifndef UTIL_SYMBOL_EXPORT #define UTIL_SYMBOL_EXPORT __attribute__((visibility("default"))) +#endif +#ifndef UTIL_SYMBOL_IMPORT #define UTIL_SYMBOL_IMPORT __attribute__((visibility("default"))) +#endif +#ifndef UTIL_SYMBOL_VISIBLE #define UTIL_SYMBOL_VISIBLE __attribute__((visibility("default"))) +#endif +#ifndef UTIL_SYMBOL_LOCAL #define UTIL_SYMBOL_LOCAL __attribute__((visibility("hidden"))) #endif + +#endif + #else // config/platform/win32.hpp will define UTIL_SYMBOL_EXPORT, etc., unless already defined +#ifndef UTIL_SYMBOL_EXPORT #define UTIL_SYMBOL_EXPORT +#endif + +#ifndef UTIL_SYMBOL_IMPORT #define UTIL_SYMBOL_IMPORT +#endif +#ifndef UTIL_SYMBOL_VISIBLE #define UTIL_SYMBOL_VISIBLE +#endif +#ifndef UTIL_SYMBOL_LOCAL #define UTIL_SYMBOL_LOCAL #endif +#endif + #elif defined(_MSC_VER) // Microsoft Visual C++ // @@ -89,9 +112,14 @@ // its boost/config/compiler/ file must define UTIL_SYMBOL_EXPORT and // UTIL_SYMBOL_IMPORT #if !defined(UTIL_SYMBOL_EXPORT) && (defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)) + +#ifndef UTIL_SYMBOL_EXPORT #define UTIL_SYMBOL_EXPORT __declspec(dllexport) +#endif +#ifndef UTIL_SYMBOL_IMPORT #define UTIL_SYMBOL_IMPORT __declspec(dllimport) #endif +#endif // ---------------- import/export: for platform ---------------- #ifndef UTIL_SYMBOL_EXPORT @@ -161,5 +189,3 @@ #define UTIL_NOINLINE #endif #endif - -#endif \ No newline at end of file