[wing/versioning] Provide version data in wingversionmacros.h
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [wing/versioning] Provide version data in wingversionmacros.h
- Date: Thu, 26 Mar 2020 13:00:55 +0000 (UTC)
commit a4bcf7c2becc27dd8e5fe0a181eba587ac49ba11
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date: Thu Mar 26 13:50:32 2020 +0100
Provide version data in wingversionmacros.h
wing/meson.build | 13 ++++++++++++-
wing/{wingversionmacros.h => wingversionmacros.h.in} | 10 ++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
---
diff --git a/wing/meson.build b/wing/meson.build
index 596e283..a154003 100644
--- a/wing/meson.build
+++ b/wing/meson.build
@@ -5,7 +5,6 @@ headers = [
'winginputstream.h',
'wingiocpinputstream.h',
'wingiocpoutputstream.h',
- 'wingversionmacros.h',
'wingnamedpipeclient.h',
'wingnamedpipeconnection.h',
'wingnamedpipelistener.h',
@@ -34,6 +33,18 @@ sources = [
'wingutils.c',
]
+version_cdata = configuration_data()
+version_cdata.set('WING_MAJOR_VERSION', wing_major_version)
+version_cdata.set('WING_MINOR_VERSION', wing_minor_version)
+version_cdata.set('WING_MICRO_VERSION', wing_micro_version)
+
+configure_file(
+ input : 'wingversionmacros.h.in',
+ output : 'wingversionmacros.h',
+ install_dir : wing_includedir,
+ configuration : version_cdata
+)
+
install_headers(headers, subdir: wing_includedir_real)
platform_deps = [ glib, gobject, gmodule, gio, gio_windows ]
diff --git a/wing/wingversionmacros.h b/wing/wingversionmacros.h.in
similarity index 70%
rename from wing/wingversionmacros.h
rename to wing/wingversionmacros.h.in
index b03f04a..ea90611 100644
--- a/wing/wingversionmacros.h
+++ b/wing/wingversionmacros.h.in
@@ -20,6 +20,16 @@
#ifndef WING_VERSION_MACROS_H
#define WING_VERSION_MACROS_H
+#define WING_MAJOR_VERSION (@WING_MAJOR_VERSION@)
+#define WING_MINOR_VERSION (@WING_MINOR_VERSION@)
+#define WING_MICRO_VERSION (@WING_MICRO_VERSION@)
+
+#define WING_CHECK_VERSION(major, minor, micro) \
+ (WING_MAJOR_VERSION > (major) || \
+ (WING_MAJOR_VERSION == (major) && WING_MINOR_VERSION > (minor)) || \
+ (WING_MAJOR_VERSION == (major) && WING_MINOR_VERSION == (minor) && \
+ WING_MICRO_VERSION >= (micro)))
+
#ifndef _WING_EXTERN
#define _WING_EXTERN extern
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]