$OpenBSD: patch-texk_dvisvgm_dvisvgm-src_libs_brotli_common_platform_h,v 1.1 2019/03/12 21:19:29 cwen Exp $
Fix for: error: missing binary operator before token "("
see: https://github.com/google/brotli/commit/6000396155a418aba75c0dab1d97cf5124aa4fb2
This should be removed once we move to ports-gcc>=8.
Index: texk/dvisvgm/dvisvgm-src/libs/brotli/common/platform.h
--- texk/dvisvgm/dvisvgm-src/libs/brotli/common/platform.h.orig
+++ texk/dvisvgm/dvisvgm-src/libs/brotli/common/platform.h
@@ -32,6 +32,18 @@
 #include <stdio.h>
 #endif
 
+#if defined(__has_builtin)
+#define BROTLI_HAS_BUILTIN(x) __has_builtin(x)
+#else
+#define BROTLI_HAS_BUILTIN(x) 0
+#endif
+
+#if defined(__has_attribute)
+#define BROTLI_HAS_ATTRIBUTE(x) __has_attribute(x)
+#else
+#define BROTLI_HAS_ATTRIBUTE(x) 0
+#endif
+
 /* Macros for compiler / platform specific features and build options.
 
    Build options are:
@@ -48,7 +60,7 @@
     * BROTLI_ENABLE_LOG enables asserts and dumps various state information
 */
 
-#if BROTLI_MODERN_COMPILER || __has_attribute(always_inline)
+#if BROTLI_MODERN_COMPILER || BROTLI_HAS_ATTRIBUTE(always_inline)
 #define BROTLI_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((always_inline))
 #else
 #define BROTLI_ATTRIBUTE_ALWAYS_INLINE
@@ -56,7 +68,7 @@
 
 #if defined(_WIN32) || defined(__CYGWIN__)
 #define BROTLI_ATTRIBUTE_VISIBILITY_HIDDEN
-#elif BROTLI_MODERN_COMPILER || __has_attribute(visibility)
+#elif BROTLI_MODERN_COMPILER || BROTLI_HAS_ATTRIBUTE(visibility)
 #define BROTLI_ATTRIBUTE_VISIBILITY_HIDDEN \
     __attribute__ ((visibility ("hidden")))
 #else
@@ -78,7 +90,7 @@
 #define BROTLI_INLINE __forceinline
 #endif  /* _MSC_VER */
 
-#if BROTLI_MODERN_COMPILER || __has_attribute(unused)
+#if BROTLI_MODERN_COMPILER || BROTLI_HAS_ATTRIBUTE(unused)
 #define BROTLI_UNUSED_FUNCTION static BROTLI_INLINE __attribute__ ((unused))
 #else
 #define BROTLI_UNUSED_FUNCTION static BROTLI_INLINE
@@ -93,7 +105,7 @@
 #define BROTLI_RESTRICT
 #endif
 
-#if BROTLI_MODERN_COMPILER || __has_attribute(noinline)
+#if BROTLI_MODERN_COMPILER || BROTLI_HAS_ATTRIBUTE(noinline)
 #define BROTLI_NOINLINE __attribute__((noinline))
 #else
 #define BROTLI_NOINLINE
@@ -313,7 +325,7 @@ OR:
   }
 
 */
-#if BROTLI_MODERN_COMPILER || __has_builtin(__builtin_expect)
+#if BROTLI_MODERN_COMPILER || BROTLI_HAS_BUILTIN(__builtin_expect)
 #define BROTLI_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
 #define BROTLI_PREDICT_FALSE(x) (__builtin_expect(x, 0))
 #else
@@ -322,7 +334,7 @@ OR:
 #endif
 
 /* BROTLI_IS_CONSTANT macros returns true for compile-time constants. */
-#if BROTLI_MODERN_COMPILER || __has_builtin(__builtin_constant_p)
+#if BROTLI_MODERN_COMPILER || BROTLI_HAS_BUILTIN(__builtin_constant_p)
 #define BROTLI_IS_CONSTANT(x) (!!__builtin_constant_p(x))
 #else
 #define BROTLI_IS_CONSTANT(x) (!!0)
