]> git.sur5r.net Git - openocd/commitdiff
Clang buildfixes
authorAlex Austin <alex.austin@spectrumdsi.com>
Fri, 29 Jan 2010 06:41:44 +0000 (00:41 -0600)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Fri, 29 Jan 2010 08:02:12 +0000 (00:02 -0800)
Building with clang took a few very small changes. The change to
helper/log.h is because clang doesn't like an expression where the
result is unused. In helper/system.h, I just defined true and false
since clang doesn't have them builtin.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
src/helper/log.h
src/helper/system.h

index ebcb8a158ec27854e56a27eabf0297deb7fcd05c..b936fee10f6fa33bb47e3ec1ed5aa8116c5ade8e 100644 (file)
@@ -111,7 +111,12 @@ extern int debug_level;
 #define LOG_LEVEL_IS(FOO)  ((debug_level) >= (FOO))
 
 #define LOG_DEBUG(expr ...) \
-               ((debug_level >= LOG_LVL_DEBUG) ? log_printf_lf (LOG_LVL_DEBUG, __FILE__, __LINE__, __FUNCTION__, expr) , 0 : 0)
+               do { \
+                       if (debug_level >= LOG_LVL_DEBUG) \
+                               log_printf_lf(LOG_LVL_DEBUG, \
+                                       __FILE__, __LINE__, __func__, \
+                                       expr); \
+               } while (0)
 
 #define LOG_INFO(expr ...) \
                log_printf_lf (LOG_LVL_INFO, __FILE__, __LINE__, __FUNCTION__, expr)
index af19d018db1dfc41c16e6cfc9b033d107f05a0bc..8ff3532aa856afb6ba1195d7bccdafbc0e42cdf0 100644 (file)
@@ -85,4 +85,9 @@
 #include <fcntl.h>
 #endif
 
+#ifndef true
+#define true   1
+#define false  0
+#endif
+
 #endif // SYSTEM_H