[gtk/ebassi/4-0-abi-bump] Prepare version macros for 4.0
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ebassi/4-0-abi-bump] Prepare version macros for 4.0
- Date: Tue, 8 Dec 2020 17:57:18 +0000 (UTC)
commit b8330b140788443ca8d36ba336d530bb432d3dce
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Dec 8 17:37:46 2020 +0000
Prepare version macros for 4.0
Remove the 3.9x version macros, and ensure that we handle 4.0 as the
backstop for the minimum required version.
gdk/gdkversionmacros.h.in | 61 ++++++++++++++++++++++++++++-------------------
1 file changed, 36 insertions(+), 25 deletions(-)
---
diff --git a/gdk/gdkversionmacros.h.in b/gdk/gdkversionmacros.h.in
index 981001ae95..b261205389 100644
--- a/gdk/gdkversionmacros.h.in
+++ b/gdk/gdkversionmacros.h.in
@@ -35,9 +35,10 @@
/**
* GDK_DISABLE_DEPRECATION_WARNINGS:
*
- * A macro that should be defined before including the gdk.h header.
- * If it is defined, no compiler warnings will be produced for uses
- * of deprecated GDK and GTK APIs.
+ * A macro that should be defined before including the `gdk.h` header.
+ *
+ * If this symbol is defined, no compiler warnings will be produced for
+ * uses of deprecated GDK and GTK APIs.
*/
#ifdef GDK_DISABLE_DEPRECATION_WARNINGS
@@ -52,9 +53,6 @@
/* XXX: Every new stable minor release bump should add a macro here */
-#define GDK_VERSION_3_92 (G_ENCODE_VERSION (3, 92))
-#define GDK_VERSION_3_94 (G_ENCODE_VERSION (3, 94))
-
/**
* GDK_VERSION_4_0:
*
@@ -65,26 +63,34 @@
/* evaluates to the current stable version; for development cycles,
- * this means the next stable target
+ * this means the next stable target, with a hard backstop to the
+ * beginning of the stable series
*/
#if (GDK_MINOR_VERSION % 2)
-#define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION + 1))
+# define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION + 1))
+#elif G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION) > GDK_VERSION_4_0
+# define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION))
#else
-#define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION))
+# define GDK_VERSION_CUR_STABLE GDK_VERSION_4_0
#endif
-/* evaluates to the previous stable version */
+/* evaluates to the previous stable version, with a hard backstop
+ * to the beginning of the stable series
+ */
#if (GDK_MINOR_VERSION % 2)
-#define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 1))
+# define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 1))
+#elif GDK_MINOR_VERSION > 2
+# define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 2))
#else
-#define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 2))
+# define GDK_VERSION_PREV_STABLE GDK_VERSION_4_0
#endif
/**
* GDK_VERSION_MIN_REQUIRED:
*
* A macro that should be defined by the user prior to including
- * the gdk.h header.
+ * the `gdk.h` header.
+ *
* The definition should be one of the predefined GDK version
* macros: %GDK_VERSION_4_0, %GDK_VERSION_4_2,...
*
@@ -102,7 +108,8 @@
* GDK_VERSION_MAX_ALLOWED:
*
* A macro that should be defined by the user prior to including
- * the gdk.h header.
+ * the `gdk.h` header.
+ *
* The definition should be one of the predefined GDK version
* macros: %GDK_VERSION_4_0, %GDK_VERSION_4_2,...
*
@@ -122,29 +129,33 @@
/* sanity checks */
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_MIN_REQUIRED
-#error "GDK_VERSION_MAX_ALLOWED must be >= GDK_VERSION_MIN_REQUIRED"
+# error "GDK_VERSION_MAX_ALLOWED must be >= GDK_VERSION_MIN_REQUIRED"
#endif
-#if GDK_VERSION_MIN_REQUIRED < GDK_VERSION_3_92
-#error "GDK_VERSION_MIN_REQUIRED must be >= GDK_VERSION_3_92"
+#if GDK_VERSION_MIN_REQUIRED < GDK_VERSION_4_0
+# error "GDK_VERSION_MIN_REQUIRED must be >= GDK_VERSION_4_0"
#endif
#define GDK_AVAILABLE_IN_ALL _GDK_EXTERN
/* XXX: Every new stable minor release should add a set of macros here */
+/* This is not really necessary for 4.0, since there can't be an
+ * earlier version, and there are no deprecated symbols. We just
+ * include it for completeness, and because it's easier to copy
+ * this stanza every time a new development cycle starts.
+ */
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_4_0
-# define GDK_AVAILABLE_IN_4_0 GDK_UNAVAILABLE(4, 0)
+# define GDK_AVAILABLE_IN_4_0 GDK_UNAVAILABLE(4, 0)
#else
-# define GDK_AVAILABLE_IN_4_0 _GDK_EXTERN
+# define GDK_AVAILABLE_IN_4_0 _GDK_EXTERN
#endif
-#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_92
-# define GDK_DEPRECATED_IN_4_0 GDK_DEPRECATED
-# define GDK_DEPRECATED_IN_4_0_FOR(f) GDK_DEPRECATED_FOR(f)
+#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_4_0
+# define GDK_DEPRECATED_IN_4_0 GDK_DEPRECATED
+# define GDK_DEPRECATED_IN_4_0_FOR(f) GDK_DEPRECATED_FOR(f)
#else
-# define GDK_DEPRECATED_IN_4_0 _GDK_EXTERN
-# define GDK_DEPRECATED_IN_4_0_FOR(f) _GDK_EXTERN
+# define GDK_DEPRECATED_IN_4_0 _GDK_EXTERN
+# define GDK_DEPRECATED_IN_4_0_FOR(f) _GDK_EXTERN
#endif
#endif /* __GDK_VERSION_MACROS_H__ */
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]