[tepl] Add tepl-macros.h with _TEPL_EXTERN



commit 3c5f909fb4ef76a4507a557d6d85496208f2d4c5
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Apr 28 16:53:03 2020 +0800

    Add tepl-macros.h with _TEPL_EXTERN
    
    This header is used to define _TEPL_EXTERN, which is defined as 'extern'
    unless it is overridden, so that we can use it to export symbols using
    compiler directives when using a symbols map is not possible.

 tepl/meson.build   |  1 +
 tepl/tepl-macros.h | 31 +++++++++++++++++++++++++++++++
 tepl/tepl.h        |  1 +
 3 files changed, 33 insertions(+)
---
diff --git a/tepl/meson.build b/tepl/meson.build
index 6ad5947..24deae4 100644
--- a/tepl/meson.build
+++ b/tepl/meson.build
@@ -15,6 +15,7 @@ tepl_public_headers = [
   'tepl-init.h',
   'tepl-io-error-info-bars.h',
   'tepl-iter.h',
+  'tepl-macros.h',
   'tepl-menu-shell.h',
   'tepl-metadata.h',
   'tepl-metadata-manager.h',
diff --git a/tepl/tepl-macros.h b/tepl/tepl-macros.h
new file mode 100644
index 0000000..c9e4337
--- /dev/null
+++ b/tepl/tepl-macros.h
@@ -0,0 +1,31 @@
+/*
+ * This file is part of Tepl, a text editor library.
+ *
+ * Copyright 2020 - Chun-wei Fan <fanc999 yahoo com tw>
+ *
+ * Tepl 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.
+ *
+ * Tepl 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef TEPL_MACROS_H
+#define TEPL_MACROS_H
+
+#if !defined (TEPL_H_INSIDE) && !defined (TEPL_COMPILATION)
+#error "Only <tepl/tepl.h> can be included directly."
+#endif
+
+#ifndef _TEPL_EXTERN
+#define _TEPL_EXTERN extern
+#endif
+
+#endif /* TEPL_MACROS_H */
diff --git a/tepl/tepl.h b/tepl/tepl.h
index 34569ec..69789f4 100644
--- a/tepl/tepl.h
+++ b/tepl/tepl.h
@@ -41,6 +41,7 @@
 #include <tepl/tepl-init.h>
 #include <tepl/tepl-io-error-info-bars.h>
 #include <tepl/tepl-iter.h>
+#include <tepl/tepl-macros.h>
 #include <tepl/tepl-menu-shell.h>
 #include <tepl/tepl-metadata.h>
 #include <tepl/tepl-metadata-manager.h>


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