[libsoup/ebassi/deprecated-symbol-macros: 1/2] Add own wrappers for deprecation macros




commit e1c2aef8e40acbce5528a6550fc99f3feabbd603
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sat Aug 13 23:11:41 2022 +0100

    Add own wrappers for deprecation macros
    
    We need to ensure that deprecated and unavailable symbols are still
    exported, so we should use our own symbol.
    
    While at it, the deprecation warnings should be toggleable.

 libsoup/soup-version.h.in | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
---
diff --git a/libsoup/soup-version.h.in b/libsoup/soup-version.h.in
index 557bf95f..8bcd75cb 100644
--- a/libsoup/soup-version.h.in
+++ b/libsoup/soup-version.h.in
@@ -91,6 +91,25 @@ G_BEGIN_DECLS
 #error "SOUP_VERSION_MIN_REQUIRED must be >= SOUP_VERSION_3_0"
 #endif
 
+/**
+ * SOUP_DISABLE_DEPRECATION_WARNINGS:
+ *
+ * A macro that should be defined before including the `soup.h` header.
+ *
+ * If this symbol is defined, no compiler warnings will be produced for
+ * uses of deprecated libsoup APIs.
+ */
+
+#ifdef SOUP_DISABLE_DEPRECATION_WARNINGS
+#define SOUP_DEPRECATED _SOUP_EXTERN
+#define SOUP_DEPRECATED_FOR(f) _SOUP_EXTERN
+#define SOUP_UNAVAILABLE(maj,min) _SOUP_EXTERN
+#else
+#define SOUP_DEPRECATED G_DEPRECATED _SOUP_EXTERN
+#define SOUP_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _SOUP_EXTERN
+#define SOUP_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min) _SOUP_EXTERN
+#endif
+
 #define SOUP_AVAILABLE_IN_ALL                   _SOUP_EXTERN
 
 {version_attributes}


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