Subject: [PATCH] libudev: Only use #pragma for ignoring diagnostics if GCC
version supports it.
-
+[Peter: update for 2.1.1, fix shared_assert issue]
Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
- src/libudev/macro.h | 5 +++++
- 1 file changed, 5 insertions(+)
+ src/shared/macro.h | 8 +++++
+ 1 file changed, 8 insertions(+)
-diff --git a/src/libudev/macro.h b/src/libudev/macro.h
-index ac2a23f..fb55983 100644
---- a/src/libudev/macro.h
-+++ b/src/libudev/macro.h
-@@ -40,12 +40,17 @@
+diff --git a/src/shared/macro.h b/src/shared/macro.h
+--- a/src/shared/macro.h
++++ b/src/shared/macro.h
+@@ -38,6 +38,7 @@
#define _cleanup_(x) __attribute__((cleanup(x)))
-
+ /* Temporarily disable some warnings */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
- #define DISABLE_WARNING_FORMAT_NONLITERAL \
+ #define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \
_Pragma("GCC diagnostic push"); \
- _Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"")
+ _Pragma("GCC diagnostic ignored \"-Wdeclaration-after-statement\"")
+@@ -48,6 +49,13 @@
#define REENABLE_WARNING \
_Pragma("GCC diagnostic pop")
+#else
++#define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT
+#define DISABLE_WARNING_FORMAT_NONLITERAL
+#define REENABLE_WARNING
++/* glibc unconditionally defines this, but it needs GCC 4.6+ */
++#undef static_assert
+#endif
- /* Rounds up */
-
+ #define XCONCATENATE(x, y) x ## y
+ #define CONCATENATE(x, y) XCONCATENATE(x, y)
--
1.7.9.5
-
depends on BR2_USE_WCHAR
depends on !BR2_STATIC_LIBS
depends on BR2_USE_MMU # eudev
+ depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
select BR2_PACKAGE_EUDEV
-comment "eudev needs a toolchain w/ largefile, wchar, dynamic library"
+comment "eudev needs a toolchain w/ largefile, wchar, dynamic library, headers >= 3.9"
depends on !BR2_avr32 # eudev
depends on BR2_USE_MMU
- depends on !BR2_LARGEFILE || !BR2_USE_WCHAR || BR2_STATIC_LIBS
+ depends on !BR2_LARGEFILE || !BR2_USE_WCHAR || BR2_STATIC_LIBS \
+ || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
endchoice