[libgd/gd.msvc: 5/8] libgd: Add header to define GD_API




commit 6c91df54fb051a559bd5bbab6c0b1d262fea6cd5
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Aug 11 16:05:08 2021 +0800

    libgd: Add header to define GD_API
    
    This is the macro that will be used to decorate the symbols in the various
    headers so that we can use compiler directives to export the symbols as
    we incorporate libgd items in our GNOME items, as necessary.  This will
    enable items such as gedit to work properly as they expect libgd items to
    be exported as well during runtime.

 Makefile.am       |  2 +-
 libgd/gd-macros.h | 32 ++++++++++++++++++++++++++++++++
 libgd/meson.build |  3 ++-
 3 files changed, 35 insertions(+), 2 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 5a07144..55c924a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,7 +24,7 @@ endif
 
 libgd_la_LIBADD = $(LIBGD_LIBS) $(LIBM)
 libgd_la_LDFLAGS = -avoid-version
-libgd_la_SOURCES = libgd/gd.h
+libgd_la_SOURCES = libgd/gd.h libgd/gd-macros.h
 nodist_libgd_la_SOURCES =
 
 catalog_sources =                              \
diff --git a/libgd/gd-macros.h b/libgd/gd-macros.h
new file mode 100644
index 0000000..a247438
--- /dev/null
+++ b/libgd/gd-macros.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Copyright (c) 2021 Chun-wei Fan
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifndef __GD_MACROS_H__
+#define __GD_MACROS_H__
+
+#ifndef GD_API
+# ifdef MSVC_EXPORT_DLL
+#  define GD_API __declspec (dllexport)
+# else
+#  define GD_API
+# endif
+#endif
+
+#endif /* __GD_MACROS_H__ */
diff --git a/libgd/meson.build b/libgd/meson.build
index 705e8fb..2c58cf4 100644
--- a/libgd/meson.build
+++ b/libgd/meson.build
@@ -2,6 +2,7 @@ gnome = import('gnome')
 
 sources = [
   'gd.h',
+  'gd-macros.h',
   'gd-types-catalog.c'
 ]
 built_sources = []
@@ -124,7 +125,7 @@ if get_option('with-notification')
   c_args += '-DLIBGD_NOTIFICATION=1'
 endif
 
-if sources.length() == 2
+if sources.length() == 3
   error('You must include a feature to be built!')
 endif
 


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