#pragma once #if defined(__GNUC__) #define _DEPRECATED_ __attribute__((deprecated)) #define _FORCE_INLINE_ __attribute__((always_inline)) #elif defined(_MSC_VER) #define _DEPRECATED_ #define _FORCE_INLINE_ __forceinline #else #define _DEPRECATED_ #define _FORCE_INLINE_ inline #endif /* Windows import/export and gnu http://gcc.gnu.org/wiki/Visibility macros. */ #if defined(_MSC_VER) #define DLL_IMPORT __declspec(dllimport) #define DLL_EXPORT __declspec(dllexport) #define DLL_LOCAL #elif __GNUC__ >= 4 #define DLL_IMPORT __attribute__ ((visibility("default"))) #define DLL_EXPORT __attribute__ ((visibility("default"))) #define DLL_LOCAL __attribute__ ((visibility("hidden"))) #else #define DLL_IMPORT #define DLL_EXPORT #define DLL_LOCALs #endif // Ignore warnings about import/exports when deriving from std classes. #ifdef _MSC_VER #pragma warning(disable: 4251) #pragma warning(disable: 4275) #endif // Import/export for windows dll's and visibility for gcc shared libraries. #ifdef BUILD_SHARED_LIBS // project is being built around shared libraries #ifdef CLASS_EXPORTS // we are building a shared lib/dll #define CLASS_DECL DLL_EXPORT #else // we are using shared lib/dll #define CLASS_DECL DLL_IMPORT #endif #ifdef FUNC_EXPORTS // we are building a shared lib/dll #define FUNC_DECL DLL_EXPORT #else // we are using shared lib/dll #define FUNC_DECL DLL_IMPORT #endif #else // project is being built around static libraries #define CLASS_DECL #define FUNC_DECL #endif
标签:__,DECL,C++,DLL,跨平台,endif,shared,define From: https://www.cnblogs.com/djh5520/p/17000977.html