Explorar o código

disable error on warning for endianness detection on clang

Julius Pfrommer %!s(int64=8) %!d(string=hai) anos
pai
achega
3dbcaad2ad
Modificáronse 1 ficheiros con 12 adicións e 0 borrados
  1. 12 0
      include/ua_config.h.in

+ 12 - 0
include/ua_config.h.in

@@ -130,6 +130,14 @@
 /**
  * Float Endianness
  * ---------------- */
+
+/* Demote error to a warning on clang. There is no robust way to detect float
+   endianness here. */
+#if defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic warning "-W#warnings"
+#endif
+
 #if !defined(_WIN32)
 # if !defined(__FLOAT_WORD_ORDER__) || !defined(__BYTE_ORDER__) || \
      !defined(__ORDER_LITTLE_ENDIAN__) || !defined(__ORDER_BIG_ENDIAN__)
@@ -149,6 +157,10 @@
 # endif
 #endif
 
+#if defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+
 /**
  * Embed unavailable libc functions
  * -------------------------------- */