0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-01-19 16:52:16 +00:00
termux-packages/packages/libwayland/src-wayland-util.h.patch
Biswapriyo Nath a9271d63c9 fix(main/libwayland): Fix compiler error when STDC_VERSION is undefined
This commit fixes the following compiler error with KDE frameworks.

wayland-util.h:51:5: error: '__STDC_VERSION__' is not defined, evaluates to 0 [-Werror,-Wundef]
   51 | #if __STDC_VERSION__ >= 202311L
      |     ^
wayland-util.h:73:5: error: '__STDC_VERSION__' is not defined, evaluates to 0 [-Werror,-Wundef]
   73 | #if __STDC_VERSION__ >= 202311L
      |     ^

Also, add `setup' option with meson command to fix the following.
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.
2024-11-12 19:50:16 +05:30

24 lines
692 B
Diff

https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/438
--- a/src/wayland-util.h
+++ b/src/wayland-util.h
@@ -48,7 +48,8 @@
#endif
/** Deprecated attribute */
-#if __STDC_VERSION__ >= 202311L
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L \
+ || defined(__cplusplus) && __cplusplus >= 201402L
#define WL_DEPRECATED [[deprecated]]
#elif defined(__GNUC__) && __GNUC__ >= 4
#define WL_DEPRECATED __attribute__ ((deprecated))
@@ -70,7 +71,7 @@
#define WL_PRINTF(x, y)
#endif
-#if __STDC_VERSION__ >= 202311L
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
#define WL_TYPEOF(expr) typeof(expr)
#else
#define WL_TYPEOF(expr) __typeof__(expr)