Commit c30818d5 authored by ChangZhuo Chen's avatar ChangZhuo Chen

Fix GCC 6 compiling error

parent ac79d98b
--- a/src/debug.h
+++ b/src/debug.h
@@ -3,10 +3,10 @@
#endif
#include <stdio.h>
-#define UCIMF_ERR(format...) {extern int LogFd; if( LogFd >=0 ){ dprintf( LogFd, "[Err]:"format );} }
-#define UCIMF_WARNING(format...) {extern int LogFd; if( LogFd >=0 ){ dprintf( LogFd, "[WARN]:"format );} }
-#define UCIMF_INFO(format...) {extern int LogFd; if( LogFd >=0 ){ dprintf( LogFd, "[INFO]:"format );} }
-#define UCIMF_DEBUG(format...) {extern int LogFd; if( LogFd >=0 ){ dprintf( LogFd, "[DEBUG]:"format);} }
+#define UCIMF_ERR(format, ...) {extern int LogFd; if( LogFd >=0 ){ dprintf( LogFd, "[Err]:" #format, ##__VA_ARGS__ );} }
+#define UCIMF_WARNING(format, ...) {extern int LogFd; if( LogFd >=0 ){ dprintf( LogFd, "[WARN]:" #format, ##__VA_ARGS__ );} }
+#define UCIMF_INFO(format, ...) {extern int LogFd; if( LogFd >=0 ){ dprintf( LogFd, "[INFO]:" #format, ##__VA_ARGS__ );} }
+#define UCIMF_DEBUG(format, ...) {extern int LogFd; if( LogFd >=0 ){ dprintf( LogFd, "[DEBUG]:" #format, ##__VA_ARGS__);} }
-#define UrINFO(format...) UCIMF_INFO(format)
-#define UrDEBUG(format...) UCIMF_DEBUG(format)
+#define UrINFO(format, ...) UCIMF_INFO(#format, ##__VA_ARGS__)
+#define UrDEBUG(format, ...) UCIMF_DEBUG(#format, ##__VA_ARGS__)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment