libredwg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libredwg] __VA_ARGS__ instead args


From: Felipe Sanches
Subject: Re: [libredwg] __VA_ARGS__ instead args
Date: Thu, 4 Mar 2010 09:13:58 -0300

Rodrigo,
can you review that, please?

-Felipe

2010/3/4 Timo Lähde <address@hidden>
Is this patch usable for ANSI C99 compilers:

--- a\logging.h Wed Mar  3 20:53:41 2010
+++ b\logging.h Thu Mar  4 10:57:34 2010
@@ -42,20 +42,20 @@
#define HANDLER fprintf
#define OUTPUT stderr

-#define LOG(level, args...) \
+#define LOG(level, ...) \
         if (DWG_LOGLEVEL >= DWG_LOGLEVEL_##level) { \
-            HANDLER(OUTPUT, args); \
+            HANDLER(OUTPUT, __VA_ARGS__); \
         }

-#define LOG_ERROR(args...) \
+#define LOG_ERROR(...) \
         if (DWG_LOGLEVEL > DWG_LOGLEVEL_ERROR) { \
             HANDLER(OUTPUT, "ERROR: "); \
-              LOG(ERROR, args) \
+              LOG(ERROR, __VA_ARGS__) \
         }

-#define LOG_INFO(args...) LOG(INFO, args)
-#define LOG_TRACE(args...) LOG(TRACE, args)
-#define LOG_ALL(args...) LOG(ALL, args)
+#define LOG_INFO(...) LOG(INFO, __VA_ARGS__)
+#define LOG_TRACE(...) LOG(TRACE, __VA_ARGS__)
+#define LOG_ALL(...) LOG(ALL, __VA_ARGS__)


#endif //#ifndef LOGGING_H


reply via email to

[Prev in Thread] Current Thread [Next in Thread]