[gtk/render-node-types: 69/75] Add macro for exported variables



commit 5e095cd208db14625a549a766f60c752c066da7b
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Apr 7 23:32:22 2020 +0100

    Add macro for exported variables
    
    The logic is based on the similar macro in GLib, but with the
    appropriate GDK symbols.

 gdk/gdktypes.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
---
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h
index 9e8a7997fa..39f151d7ba 100644
--- a/gdk/gdktypes.h
+++ b/gdk/gdktypes.h
@@ -557,4 +557,26 @@ struct _GdkKeymapKey
 
 G_END_DECLS
 
+/*< private >
+ * GDK_EXTERN_VAR:
+ *
+ * A macro to annotate extern variables so that they show up properly in
+ * Windows DLLs.
+ */
+#ifndef GDK_EXTERN_VAR
+#  ifdef G_PLATFORM_WIN32
+#    ifdef GTK_COMPILATION
+#      ifdef DLL_EXPORT
+#        define GDK_EXTERN_VAR __declspec(dllexport)
+#      else /* !DLL_EXPORT */
+#        define GDK_EXTERN_VAR extern
+#      endif /* !DLL_EXPORT */
+#    else /* !GTK_COMPILATION */
+#      define GDK_EXTERN_VAR extern __declspec(dllimport)
+#    endif /* !GTK_COMPILATION */
+#  else /* !G_PLATFORM_WIN32 */
+#    define GDK_EXTERN_VAR _GDK_EXTERN
+#  endif /* !G_PLATFORM_WIN32 */
+#endif /* GDK_EXTERN_VAR */
+
 #endif /* __GDK_TYPES_H__ */


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