Browse Source

Fix GCC compilation

On GNUC use the GCC extension "##__VA_ARGS__"
Hansi P 1 year ago
parent
commit
ebd2f1f99a
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/civetweb.c

+ 5 - 0
src/civetweb.c

@@ -230,8 +230,13 @@ static void DEBUG_TRACE_FUNC(const char *func,
                              PRINTF_FORMAT_STRING(const char *fmt),
                              ...) PRINTF_ARGS(3, 4);
 
+#if defined(__GNUC__)
+#define DEBUG_TRACE(fmt, ...)                                                  \
+	DEBUG_TRACE_FUNC(__func__, __LINE__, fmt, ##__VA_ARGS__)
+#else
 #define DEBUG_TRACE(fmt, ...)                                                  \
 	DEBUG_TRACE_FUNC(__func__, __LINE__, fmt, __VA_ARGS__)
+#endif
 
 #define NEED_DEBUG_TRACE_FUNC
 #if !defined(DEBUG_TRACE_STREAM)