Merge remote branch 'origin/master' into nv50-compiler
[mesa.git] / src / mesa / drivers / dri / radeon / radeon_debug.h
index 2a8302293b2a37caa9aa42ddea8e0b5edce543e4..ef8b9671ac96835758cb3a977553171eaf40ef3d 100644 (file)
@@ -47,7 +47,11 @@ typedef enum radeon_debug_levels {
  * errors.
  */
 #ifndef RADEON_DEBUG_LEVEL
-#define RADEON_DEBUG_LEVEL RADEON_VERBOSE
+# ifdef DEBUG
+#  define RADEON_DEBUG_LEVEL RADEON_TRACE
+# else
+#  define RADEON_DEBUG_LEVEL RADEON_VERBOSE
+# endif
 #endif
 
 typedef enum radeon_debug_types {
@@ -149,21 +153,22 @@ static inline void radeon_debug_remove_indent(void)
        }
 }
 
+
 /* From http://gcc. gnu.org/onlinedocs/gcc-3.2.3/gcc/Variadic-Macros.html .
    I suppose we could inline this and use macro to fetch out __LINE__ and stuff in case we run into trouble
    with other compilers ... GLUE!
 */
-#define WARN_ONCE(a, ...)      { \
-       static int warn##__LINE__=1; \
-       if(warn##__LINE__){ \
+#define WARN_ONCE(a, ...)      do { \
+       static int __warn_once=1; \
+       if(__warn_once){ \
                radeon_warning("*********************************WARN_ONCE*********************************\n"); \
                radeon_warning("File %s function %s line %d\n", \
                        __FILE__, __FUNCTION__, __LINE__); \
                radeon_warning(  (a), ## __VA_ARGS__);\
                radeon_warning("***************************************************************************\n"); \
-               warn##__LINE__=0;\
+               __warn_once=0;\
                } \
-       }
+       } while(0)
 
 
 #endif