[libhandy] version: Update deprecation macros



commit 4e3b23b8e276b267d68cbc401b55d0ba7e9e5c1f
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Feb 10 16:13:27 2021 +0500

    version: Update deprecation macros
    
    We need to combine them with _HDY_EXTERN to handle exporting. Along the
    way, align them with GDK, adding per-version deprecations, and drop the
    duplicate macros we've never used. Drop hdy-deprecation-macros.h and merge
    the 2 remaining macros into hdy-version.h as we need to declare them after
    _HDY_EXTERN and it gets messy otherwise.

 src/handy.h                  |  1 -
 src/hdy-deprecation-macros.h | 31 -------------------------------
 src/hdy-version.h.in         | 28 ++++++++++++++++++++++++++++
 src/meson.build              |  1 -
 4 files changed, 28 insertions(+), 33 deletions(-)
---
diff --git a/src/handy.h b/src/handy.h
index 4c137234..07257f82 100644
--- a/src/handy.h
+++ b/src/handy.h
@@ -31,7 +31,6 @@ G_BEGIN_DECLS
 #include "hdy-clamp.h"
 #include "hdy-combo-row.h"
 #include "hdy-deck.h"
-#include "hdy-deprecation-macros.h"
 #include "hdy-enum-value-object.h"
 #include "hdy-expander-row.h"
 #include "hdy-flap.h"
diff --git a/src/hdy-version.h.in b/src/hdy-version.h.in
index 856ff7b4..773d00c0 100644
--- a/src/hdy-version.h.in
+++ b/src/hdy-version.h.in
@@ -94,10 +94,26 @@
 #define _HDY_EXTERN extern
 #endif
 
+#if defined(HDY_DISABLE_DEPRECATION_WARNINGS) || defined(HANDY_COMPILATION)
+#  define _HDY_DEPRECATED             _HDY_EXTERN
+#  define _HDY_DEPRECATED_FOR(f)      _HDY_EXTERN
+#  define _HDY_DEPRECATED_TYPE
+#  define _HDY_DEPRECATED_TYPE_FOR(f)
+#else
+#  define _HDY_DEPRECATED             G_DEPRECATED        _HDY_EXTERN
+#  define _HDY_DEPRECATED_FOR(f)      G_DEPRECATED_FOR(f) _HDY_EXTERN
+#  define _HDY_DEPRECATED_TYPE        G_DEPRECATED
+#  define _HDY_DEPRECATED_TYPE_FOR(f) G_DEPRECATED_FOR(f)
+#endif
+
 #ifndef HDY_VERSION_MAX_ALLOWED
 # define HDY_VERSION_MAX_ALLOWED HDY_VERSION_1_1
 #endif
 
+#ifndef HDY_VERSION_MIN_REQUIRED
+# define HDY_VERSION_MIN_REQUIRED HDY_VERSION_1_1
+#endif
+
 #define HDY_UNAVAILABLE(major, minor) G_UNAVAILABLE(major, minor) _HDY_EXTERN
 
 #define HDY_AVAILABLE_IN_ALL _HDY_EXTERN
@@ -107,3 +123,15 @@
 #else
 # define HDY_AVAILABLE_IN_1_1 _HDY_EXTERN
 #endif
+
+#if HDY_VERSION_MIN_REQUIRED >= HDY_VERSION_1_1
+# define HDY_DEPRECATED_IN_1_1             _HDY_DEPRECATED
+# define HDY_DEPRECATED_IN_1_1_FOR(f)      _HDY_DEPRECATED_FOR(f)
+# define HDY_DEPRECATED_TYPE_IN_1_1        _HDY_DEPRECATED_TYPE
+# define HDY_DEPRECATED_TYPE_IN_1_1_FOR(f) _HDY_DEPRECATED_TYPE_FOR(f)
+#else
+# define HDY_DEPRECATED_IN_1_1             _HDY_EXTERN
+# define HDY_DEPRECATED_IN_1_1_FOR(f)      _HDY_EXTERN
+# define HDY_DEPRECATED_TYPE_IN_1_1
+# define HDY_DEPRECATED_TYPE_IN_1_1_FOR(f)
+#endif
diff --git a/src/meson.build b/src/meson.build
index e2f3241f..042aad65 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -76,7 +76,6 @@ src_headers = [
   'hdy-clamp.h',
   'hdy-combo-row.h',
   'hdy-deck.h',
-  'hdy-deprecation-macros.h',
   'hdy-enum-value-object.h',
   'hdy-expander-row.h',
   'hdy-flap.h',


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