[atkmm/use-dllexport: 1/5] atk/atkmmconfig.h.in: Re-organize ATKMM_API definition



commit 6509ed3e52f5a64b65033fe6e971df519ed40449
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Apr 1 17:25:47 2020 +0800

    atk/atkmmconfig.h.in: Re-organize ATKMM_API definition
    
    We also activate ATKMM_DLL when we are building with Visual Studio, and
    define ATKMM_API as __declspec(dllexport) when ATKMM_DLL and ATKMM_BUILD
    are defined.

 atk/atkmmconfig.h.in | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/atk/atkmmconfig.h.in b/atk/atkmmconfig.h.in
index d744602..161f131 100644
--- a/atk/atkmmconfig.h.in
+++ b/atk/atkmmconfig.h.in
@@ -18,13 +18,16 @@
 #undef ATKMM_STATIC_LIB
 
 /* Enable DLL-specific stuff only when not building a static library */
-#if !defined(ATKMM_STATIC_LIB) defined(__MINGW32__) && !defined(__CYGWIN__)
+#if !defined(ATKMM_STATIC_LIB) && ((defined(__MINGW32__) && !defined(__CYGWIN__)) || defined (_MSC_VER))
 # define ATKMM_DLL 1
 #endif
 
-/* Do not dllexport as it is handled by gendef on MSVC */
-#if defined(ATKMM_DLL) && !defined(ATKMM_BUILD)
-# define ATKMM_API __declspec(dllimport)
+#ifdef ATKMM_DLL
+# ifdef ATKMM_BUILD
+#  define ATKMM_API __declspec(dllexport)
+# else
+#  define ATKMM_API __declspec(dllimport)
+# endif
 #else
 # define ATKMM_API
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]