t/test-lib-functions.sh: avoid "test <cond> -a/-o <cond>"
[gitweb.git] / git-compat-util.h
index 76910e6cd16f128be9430ac86f35a8e06d390e0f..7849d314051a1de351c9c985516135397042a091 100644 (file)
@@ -330,8 +330,12 @@ extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)))
  * trying to help gcc, anyway, it's OK; other compilers will fall back to
  * using the function as usual.
  */
-#if defined(__GNUC__) && ! defined(__clang__)
-#define error(...) (error(__VA_ARGS__), -1)
+#if defined(__GNUC__)
+static inline int const_error(void)
+{
+       return -1;
+}
+#define error(...) (error(__VA_ARGS__), const_error())
 #endif
 
 extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params));