gplugin/gplugin

9706b247f96c
Parents 28981a66ff9d
Children ba6874e1ad57
Move the generated version stuff out to its own headerfile

Testing Done:
Ran the unit tests.

Reviewed at https://reviews.imfreedom.org/r/1154/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/gplugin-version-defs.h.in Wed Dec 08 01:33:01 2021 -0600
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2011-2020 Gary Kramlich <grim@reaperworld.com>
+ *
+ * This library 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 library 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 <https://www.gnu.org/licenses/>.
+ */
+
+#if !defined(GPLUGIN_GLOBAL_HEADER_INSIDE) && !defined(GPLUGIN_COMPILATION)
+#error "only <gplugin.h> may be included directly"
+#endif
+
+#ifndef GPLUGIN_VERSION_DEFS_H
+#define GPLUGIN_VERSION_DEFS_H
+
+#define GPLUGIN_MAJOR_VERSION (@GPLUGIN_MAJOR_VERSION@)
+#define GPLUGIN_MINOR_VERSION (@GPLUGIN_MINOR_VERSION@)
+#define GPLUGIN_MICRO_VERSION (@GPLUGIN_MICRO_VERSION@)
+#define GPLUGIN_EXTRA_VERSION "@GPLUGIN_EXTRA_VERSION@"
+
+#define GPLUGIN_VERSION "@GPLUGIN_VERSION@"
+
+#endif /* GPLUGIN_VERSION_DEFS_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/gplugin-version.h Wed Dec 08 01:33:01 2021 -0600
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2011-2020 Gary Kramlich <grim@reaperworld.com>
+ *
+ * This library 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 library 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 <https://www.gnu.org/licenses/>.
+ */
+
+#if !defined(GPLUGIN_GLOBAL_HEADER_INSIDE) && !defined(GPLUGIN_COMPILATION)
+#error "only <gplugin.h> may be included directly"
+#endif
+
+#ifndef GPLUGIN_VERSION_H
+#define GPLUGIN_VERSION_H
+
+#include <gplugin/gplugin-version-defs.h>
+
+#define GPLUGIN_VERSION_CHECK(major,minor,micro) \
+ ((major) == GPLUGIN_MAJOR_VERSION && \
+ ((minor) < GPLUGIN_MINOR_VERSION || \
+ ((minor) == GPLUGIN_MINOR_VERSION && (micro) <= GPLUGIN_MICRO_VERSION)))
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+const gchar *gplugin_version_check(guint major, guint minor, guint micro);
+
+gint gplugin_version_compare(const gchar *v1, const gchar *v2);
+
+G_END_DECLS
+
+#endif /* GPLUGIN_VERSION_H */
--- a/gplugin/gplugin-version.h.in Mon Dec 06 22:51:26 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2011-2020 Gary Kramlich <grim@reaperworld.com>
- *
- * This library 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 library 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 <https://www.gnu.org/licenses/>.
- */
-
-#if !defined(GPLUGIN_GLOBAL_HEADER_INSIDE) && !defined(GPLUGIN_COMPILATION)
-#error "only <gplugin.h> may be included directly"
-#endif
-
-#ifndef GPLUGIN_VERSION_H
-#define GPLUGIN_VERSION_H
-
-#define GPLUGIN_MAJOR_VERSION (@GPLUGIN_MAJOR_VERSION@)
-#define GPLUGIN_MINOR_VERSION (@GPLUGIN_MINOR_VERSION@)
-#define GPLUGIN_MICRO_VERSION (@GPLUGIN_MICRO_VERSION@)
-#define GPLUGIN_EXTRA_VERSION "@GPLUGIN_EXTRA_VERSION@"
-
-#define GPLUGIN_VERSION "@GPLUGIN_VERSION@"
-
-#define GPLUGIN_VERSION_CHECK(major,minor,micro) \
- ((major) == GPLUGIN_MAJOR_VERSION && \
- ((minor) < GPLUGIN_MINOR_VERSION || \
- ((minor) == GPLUGIN_MINOR_VERSION && (micro) <= GPLUGIN_MICRO_VERSION)))
-
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-const gchar *gplugin_version_check(guint major, guint minor, guint micro);
-
-gint gplugin_version_compare(const gchar *v1, const gchar *v2);
-
-G_END_DECLS
-
-#endif /* GPLUGIN_VERSION_H */
--- a/gplugin/meson.build Mon Dec 06 22:51:26 2021 -0600
+++ b/gplugin/meson.build Wed Dec 08 01:33:01 2021 -0600
@@ -11,6 +11,7 @@
'gplugin-options.h',
'gplugin-plugin.h',
'gplugin-plugin-info.h',
+ 'gplugin-version.h',
]
GPLUGIN_SOURCES = [
@@ -97,8 +98,8 @@
# Configure Files
###############################################################################
gplugin_version_h = configure_file(
- input : 'gplugin-version.h.in',
- output : 'gplugin-version.h',
+ input : 'gplugin-version-defs.h.in',
+ output : 'gplugin-version-defs.h',
configuration : version_conf,
install : true,
install_dir : get_option('includedir') / 'gplugin-1.0' / 'gplugin'
@@ -112,7 +113,7 @@
# Build gplugin.h
GPLUGIN_H_INCLUDES = ''
-foreach header : GPLUGIN_HEADERS + ['gplugin-version.h', 'gplugin-enums.h']
+foreach header : GPLUGIN_HEADERS + ['gplugin-version-defs.h', 'gplugin-enums.h']
GPLUGIN_H_INCLUDES = '@0@\n#include <gplugin/@1@>'.format(
GPLUGIN_H_INCLUDES,
header)