Kaynağa Gözat

disable error on warning for endianness detection on clang

Julius Pfrommer 8 yıl önce
ebeveyn
işleme
3dbcaad2ad
1 değiştirilmiş dosya ile 12 ekleme ve 0 silme
  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
  * -------------------------------- */