]> sigrok.org Git - libsigrokdecode.git/blobdiff - libsigrokdecode-internal.h
internal: introduce ALL_ZERO declaration, modelled after libsigrok
[libsigrokdecode.git] / libsigrokdecode-internal.h
index 329a10ab9462f7661c7e5a4f3a5390e4fd38fb19..453e14bf57a3bf45964ff8a59a92c78431dc76d1 100644 (file)
 #include <Python.h> /* First, so we avoid a _POSIX_C_SOURCE warning. */
 #include "libsigrokdecode.h"
 
+/*
+ * Static definition of tables ending with an all-zero sentinel entry
+ * may raise warnings when compiling with -Wmissing-field-initializers.
+ * GCC suppresses the warning only with { 0 }, clang wants { } instead.
+ */
+#ifdef __clang__
+#  define ALL_ZERO { }
+#else
+#  define ALL_ZERO { 0 }
+#endif
+
 enum {
        SRD_TERM_ALWAYS_FALSE,
        SRD_TERM_HIGH,