[goocanvas/meson.msvc: 1/6] src/: Add goocanvasexports.h




commit a20962113d848cdd571cda9fb06afe6de51d121c
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Sat Jun 12 12:10:03 2021 +0800

    src/: Add goocanvasexports.h
    
    This adds a public header that can be used to export and import public API and
    variables so that goocanvas can be buildable and usable on Visual Studio builds
    as well

 src/Makefile.am        |  1 +
 src/goocanvasexports.h | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 2f7d4f3..e893c24 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -29,6 +29,7 @@ libgoocanvasincludedir = $(includedir)/goocanvas-3.0
 
 libgoocanvas_public_headers =          \
        goocanvasellipse.h              \
+       goocanvasexports.h              \
        goocanvasgrid.h                 \
        goocanvasgroup.h                \
        goocanvasimage.h                \
diff --git a/src/goocanvasexports.h b/src/goocanvasexports.h
new file mode 100644
index 0000000..96ecd58
--- /dev/null
+++ b/src/goocanvasexports.h
@@ -0,0 +1,25 @@
+/*
+ * GooCanvas. Copyright (C) 2005-6 Damon Chaplin.
+ * Released under the GNU LGPL license. See COPYING for details.
+ *
+ * goocanvasexports.h - API export/import macros
+ */
+#ifndef __GOO_CANVAS_EXPORTS_H__
+#define __GOO_CANVAS_EXPORTS_H__
+
+#include <glib.h>
+
+#if defined (G_OS_WIN32) && defined (_MSC_VER) && !defined (GOOCANVAS_BUILD_STATIC)
+# ifdef BUILDING_GOOCANVAS
+#  define GOOCANVAS_EXTERNAL_V __declspec(dllexport) extern
+#  define GOOCANVAS_API        __declspec(dllexport)
+# else
+#  define GOOCANVAS_EXTERNAL_V __declspec(dllimport) extern
+#  define GOOCANVAS_API        __declspec(dllimport)
+# endif
+#else
+# define GOOCANVAS_EXTERNAL_V  extern
+# define GOOCANVAS_API
+#endif
+
+#endif /* __GOO_CANVAS_EXPORTS_H__ */


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