Check for and use appropriate type of variadic macro arguments.
[srvx.git] / src / mod-snoop.c
index 899309d59e6004b6e43ac1a7a698d4afc4a977d3..84ecd66c14babfc2484ed5c3a5186e18e448c7d1 100644 (file)
@@ -54,7 +54,11 @@ const char *snoop_module_deps[] = { NULL };
 static int finalized;
 int snoop_finalize(void);
 
-#define SNOOP(FORMAT, ARGS...) send_channel_message(snoop_cfg.channel, snoop_cfg.bot, "%s "FORMAT, timestamp , ## ARGS)
+#if defined(GCC_VARMACROS)
+# define SNOOP(FORMAT, ARGS...) send_channel_message(snoop_cfg.channel, snoop_cfg.bot, "%s "FORMAT, timestamp, ARGS)
+#elif defined(C99_VARMACROS)
+# define SNOOP(FORMAT, ...) send_channel_message(snoop_cfg.channel, snoop_cfg.bot, "%s "FORMAT, timestamp, __VA_ARGS__)
+#endif
 #define UPDATE_TIMESTAMP() do { time_t feh = now; strftime(timestamp, sizeof(timestamp), "[%H:%M:%S]", localtime(&feh)); } while (0)
 
 static void