[libpeas/msvc: 5/12] libpeas: Add a header to decorate public symbols for export



commit f4a0fe7e7d57c382d538f3ab41c0ea109b4d8bf9
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Oct 15 12:58:21 2018 +0800

    libpeas: Add a header to decorate public symbols for export
    
    Decorate all public symbols with _PEAS_EXTERN, which is defined to
    nothing as default, so that we can export the symbols using compiler
    directives by re-defining _PEAS_EXTERN during the compilation process.

 libpeas/peas-macros.h    | 41 +++++++++++++++++++++++++++++++++++++++++
 libpeas/peas-sources.mak |  1 +
 2 files changed, 42 insertions(+)
---
diff --git a/libpeas/peas-macros.h b/libpeas/peas-macros.h
new file mode 100644
index 0000000..2921c0f
--- /dev/null
+++ b/libpeas/peas-macros.h
@@ -0,0 +1,41 @@
+/*
+ * peas-macros.h
+ * This file is part of libpeas, based on GLib's gmacros.h and gversionmacros.h.
+ *
+ * libpeas 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.1 of the License, or (at your option) any later version.
+ *
+ * libpeas 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
+ */
+
+#ifndef __PEAS_MACROS_H__
+#define __PEAS_MACROS_H__
+
+#include <glib.h>
+
+#ifndef _PEAS_EXTERN
+#define _PEAS_EXTERN
+#endif
+
+#ifdef PEAS_DISABLE_DEPRECATION_WARNINGS
+#define PEAS_DEPRECATED _PEAS_EXTERN
+#define PEAS_DEPRECATED_FOR(f) _PEAS_EXTERN
+#define PEAS_UNAVAILABLE(maj,min) _PEAS_EXTERN
+#else
+#define PEAS_DEPRECATED G_DEPRECATED _PEAS_EXTERN
+#define PEAS_DEPRECATED_FOR(f) G_DEPRECATED(f) _PEAS_EXTERN
+#define PEAS_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min) _PEAS_EXTERN
+#endif
+
+#define PEAS_API _PEAS_EXTERN
+
+#endif /* __PEAS_MACROS_H__ */
\ No newline at end of file
diff --git a/libpeas/peas-sources.mak b/libpeas/peas-sources.mak
index a008994..af871b1 100644
--- a/libpeas/peas-sources.mak
+++ b/libpeas/peas-sources.mak
@@ -1,5 +1,6 @@
 PEAS_PUBLIC_HDRS       =       \
        peas-autocleanups.h     \
+       peas-macros.h           \
        peas-plugin-info.h      \
        peas-object-module.h    \
        peas-extension-base.h   \


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