[gtksourceview] Version macros: better handle 3.99 case and add TODO comment



commit 61ac0b5bc45ef33b450bce7b8bd923dd24c9e083
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Dec 14 13:55:20 2017 +0100

    Version macros: better handle 3.99 case and add TODO comment

 gtksourceview/gtksourceversion.h.in |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourceversion.h.in b/gtksourceview/gtksourceversion.h.in
index 70df413..f46aa09 100644
--- a/gtksourceview/gtksourceversion.h.in
+++ b/gtksourceview/gtksourceversion.h.in
@@ -226,9 +226,13 @@ G_BEGIN_DECLS
  */
 #define GTK_SOURCE_VERSION_4_0 (G_ENCODE_VERSION (4, 0))
 
+/* Define GTK_SOURCE_VERSION_CUR_STABLE */
+/* TODO: remove 3.99 special case once GtkSourceView 4 is released, since it'll
+ * be dead code (GTK_SOURCE_MAJOR_VERSION will never be equal to 3 anymore).
+ */
 #ifndef __GTK_DOC_IGNORE__
 #  if (GTK_SOURCE_MINOR_VERSION % 2)
-#    if (GTK_SOURCE_MINOR_VERSION == 99)
+#    if ((GTK_SOURCE_MAJOR_VERSION == 3) && (GTK_SOURCE_MINOR_VERSION == 99))
 #      define GTK_SOURCE_VERSION_CUR_STABLE (G_ENCODE_VERSION (GTK_SOURCE_MAJOR_VERSION + 1, 0))
 #    else
 #      define GTK_SOURCE_VERSION_CUR_STABLE (G_ENCODE_VERSION (GTK_SOURCE_MAJOR_VERSION, 
GTK_SOURCE_MINOR_VERSION + 1))
@@ -238,6 +242,7 @@ G_BEGIN_DECLS
 #  endif
 #endif /* __GTK_DOC_IGNORE__ */
 
+/* Define GTK_SOURCE_VERSION_PREV_STABLE */
 #ifndef __GTK_DOC_IGNORE__
 #if (GTK_SOURCE_MINOR_VERSION % 2)
 #define GTK_SOURCE_VERSION_PREV_STABLE (G_ENCODE_VERSION (GTK_SOURCE_MAJOR_VERSION, GTK_SOURCE_MINOR_VERSION 
- 1))


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