mcst-linux-kernel/patches-2024.06.26/NetworkManager-1.22.5/0001-problem_macro.patch

26 lines
1.0 KiB
Diff

Subject: lcc compatibility
Tags: lcc
diff -Naur orig/shared/nm-glib-aux/nm-macros-internal.h new/shared/nm-glib-aux/nm-macros-internal.h
--- orig/shared/nm-glib-aux/nm-macros-internal.h 2020-02-28 17:38:20.410205030 +0300
+++ new/shared/nm-glib-aux/nm-macros-internal.h 2020-02-28 17:48:28.669137586 +0300
@@ -678,14 +678,18 @@
#endif
#if _NM_CC_SUPPORT_GENERIC
+#if defined(__LCC__)
+#define NM_PROPAGATE_CONST(test_expr, ptr) (ptr)
+#else
#define NM_PROPAGATE_CONST(test_expr, ptr) \
(_Generic ((test_expr), \
const typeof (*(test_expr)) *: ((const typeof (*(ptr)) *) (ptr)), \
default: (_Generic ((test_expr), \
typeof (*(test_expr)) *: (ptr)))))
+#endif /*defined(__LCC__)*/
#else
#define NM_PROPAGATE_CONST(test_expr, ptr) (ptr)
-#endif
+#endif /*_NM_CC_SUPPORT_GENERIC*/
/* with the way it is implemented, the caller may or may not pass a trailing
* ',' and it will work. However, this makes the macro unsuitable for initializing