Merge pull request #217 from Lastique/cygwin_dllattr

Use dllimport/dllexport with clang and gcc on Cygwin.
This commit is contained in:
jzmaddock
2018-03-16 18:15:30 +00:00
committed by GitHub
2 changed files with 8 additions and 4 deletions

View File

@@ -98,11 +98,15 @@
// //
// Dynamic shared object (DSO) and dynamic-link library (DLL) support // Dynamic shared object (DSO) and dynamic-link library (DLL) support
// //
#if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32) #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)
# define BOOST_HAS_DECLSPEC
# define BOOST_SYMBOL_EXPORT __attribute__((__dllexport__))
# define BOOST_SYMBOL_IMPORT __attribute__((__dllimport__))
#else
# define BOOST_SYMBOL_EXPORT __attribute__((__visibility__("default"))) # define BOOST_SYMBOL_EXPORT __attribute__((__visibility__("default")))
# define BOOST_SYMBOL_IMPORT # define BOOST_SYMBOL_IMPORT
# define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default")))
#endif #endif
#define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default")))
// //
// The BOOST_FALLTHROUGH macro can be used to annotate implicit fall-through // The BOOST_FALLTHROUGH macro can be used to annotate implicit fall-through

View File

@@ -99,10 +99,10 @@
// Dynamic shared object (DSO) and dynamic-link library (DLL) support // Dynamic shared object (DSO) and dynamic-link library (DLL) support
// //
#if __GNUC__ >= 4 #if __GNUC__ >= 4
# if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(__CYGWIN__) # if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)
// All Win32 development environments, including 64-bit Windows and MinGW, define // 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, // _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment,
// so does not define _WIN32 or its variants. // so does not define _WIN32 or its variants, but still supports dllexport/dllimport.
# define BOOST_HAS_DECLSPEC # define BOOST_HAS_DECLSPEC
# define BOOST_SYMBOL_EXPORT __attribute__((__dllexport__)) # define BOOST_SYMBOL_EXPORT __attribute__((__dllexport__))
# define BOOST_SYMBOL_IMPORT __attribute__((__dllimport__)) # define BOOST_SYMBOL_IMPORT __attribute__((__dllimport__))