[tepl/master.msvc: 3/8] tepl: Add tepl-macros.h



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

    tepl: Add tepl-macros.h
    
    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 | 32 ++++++++++++++++++++++++++++++++
 tepl/tepl.h        |  1 +
 3 files changed, 34 insertions(+)
---
diff --git a/tepl/meson.build b/tepl/meson.build
index a7bc27a..58e07f4 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..4db9067
--- /dev/null
+++ b/tepl/tepl-macros.h
@@ -0,0 +1,32 @@
+/*
+ * This file is part of Tepl, a text editor library.
+ *
+ * Copyright 2016-2020 - Sébastien Wilmet <swilmet gnome org>
+ * 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 */
\ No newline at end of file
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]