[libadwaita/wip/exalm/version-macros: 3/4] version: Add 1.2 version macros




commit 678a5b0b8f8440ea4e1fcc3a97418725e7fb418c
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Apr 6 22:06:50 2022 +0400

    version: Add 1.2 version macros

 src/adw-version.h.in | 45 ++++++++++++++++++++++++++++++---------------
 1 file changed, 30 insertions(+), 15 deletions(-)
---
diff --git a/src/adw-version.h.in b/src/adw-version.h.in
index 3c96ba70..cba2fd3e 100644
--- a/src/adw-version.h.in
+++ b/src/adw-version.h.in
@@ -1,16 +1,3 @@
-/*
- * Copyright (C) 2017 Purism SPC
- *
- * SPDX-License-Identifier: LGPL-2.1-or-later
- */
-
-#pragma once
-
-#if !defined(_ADWAITA_INSIDE) && !defined(ADWAITA_COMPILATION)
-#error "Only <adwaita.h> can be included directly."
-#endif
-
-#include <glib.h>
 
 G_BEGIN_DECLS
 
@@ -87,16 +74,26 @@ G_BEGIN_DECLS
  */
 #define ADW_VERSION_1_1 (ADW_ENCODE_VERSION (1, 1, 0))
 
+/**
+ * ADW_VERSION_1_2:
+ *
+ * A macro that evaluates to the 1.2 version of Adwaita, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 1.2
+ */
+#define ADW_VERSION_1_2 (ADW_ENCODE_VERSION (1, 2, 0))
+
 #ifndef _ADW_EXTERN
 #define _ADW_EXTERN extern
 #endif
 
 #ifndef ADW_VERSION_MAX_ALLOWED
-# define ADW_VERSION_MAX_ALLOWED ADW_VERSION_1_1
+# define ADW_VERSION_MAX_ALLOWED ADW_VERSION_1_2
 #endif
 
 #ifndef ADW_VERSION_MIN_REQUIRED
-# define ADW_VERSION_MIN_REQUIRED ADW_VERSION_1_1
+# define ADW_VERSION_MIN_REQUIRED ADW_VERSION_1_2
 #endif
 
 #if ADW_VERSION_MAX_ALLOWED < ADW_VERSION_1_1
@@ -117,6 +114,24 @@ G_BEGIN_DECLS
 # define ADW_DEPRECATED_TYPE_IN_1_1_FOR(f)
 #endif
 
+#if ADW_VERSION_MAX_ALLOWED < ADW_VERSION_1_2
+# define ADW_AVAILABLE_IN_1_2 ADW_UNAVAILABLE(1, 2)
+#else
+# define ADW_AVAILABLE_IN_1_2 _ADW_EXTERN
+#endif
+
+#if ADW_VERSION_MIN_REQUIRED >= ADW_VERSION_1_2
+# define ADW_DEPRECATED_IN_1_2             _ADW_DEPRECATED
+# define ADW_DEPRECATED_IN_1_2_FOR(f)      _ADW_DEPRECATED_FOR(f)
+# define ADW_DEPRECATED_TYPE_IN_1_2        _ADW_DEPRECATED_TYPE
+# define ADW_DEPRECATED_TYPE_IN_1_2_FOR(f) _ADW_DEPRECATED_TYPE_FOR(f)
+#else
+# define ADW_DEPRECATED_IN_1_2             _ADW_EXTERN
+# define ADW_DEPRECATED_IN_1_2_FOR(f)      _ADW_EXTERN
+# define ADW_DEPRECATED_TYPE_IN_1_2
+# define ADW_DEPRECATED_TYPE_IN_1_2_FOR(f)
+#endif
+
 #define ADW_UNAVAILABLE(major, minor) G_UNAVAILABLE(major, minor) _ADW_EXTERN
 
 #define ADW_AVAILABLE_IN_ALL _ADW_EXTERN


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