aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/radeon/radeon_debug.h
diff options
context:
space:
mode:
authorPauli Nieminen <[email protected]>2009-08-30 22:07:13 +0300
committerPauli Nieminen <[email protected]>2009-08-31 20:27:48 +0300
commitb6ebcf8156c4735c2e96e5aad26c3a8dc29f50a6 (patch)
tree0cfe7dcc8460735a515c465bf396d0458a5e9d7e /src/mesa/drivers/dri/radeon/radeon_debug.h
parent4e0d99a63588c67a955f797733da32d04e6f4ee6 (diff)
radeon: Add gcc attribute to enable pritnf format warnings.
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_debug.h')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_debug.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_debug.h b/src/mesa/drivers/dri/radeon/radeon_debug.h
index ace8a99e266..445217474c1 100644
--- a/src/mesa/drivers/dri/radeon/radeon_debug.h
+++ b/src/mesa/drivers/dri/radeon/radeon_debug.h
@@ -81,6 +81,20 @@ static inline int radeon_is_debug_enabled(const radeon_debug_type_t type,
return RADEON_DEBUG_LEVEL <= level
&& (type & radeon_enabled_debug_types);
}
+/*
+ * define macro for gcc specific __attribute__ if using alternative compiler
+ */
+#ifndef __GNUC__
+#define __attribute__(x) /*empty*/
+#endif
+
+/**
+ * Format attribute requires declaration for setting it. Don't ask me why!
+ */
+static inline void radeon_print(const radeon_debug_type_t type,
+ const radeon_debug_level_t level,
+ const char* message,
+ ...) __attribute__((format(printf,3,4)));
/**
* Print out debug message if channel specified by type is enabled
@@ -101,6 +115,7 @@ static inline void radeon_print(const radeon_debug_type_t type,
}
}
+static inline void radeon_error(const char* message, ...) __attribute__((format(printf,1,2)));
/**
* printf style function for writing error messages.
*/
@@ -112,6 +127,7 @@ static inline void radeon_error(const char* message, ...)
va_end( values );
}
+static inline void radeon_warning(const char* message, ...) __attribute__((format(printf,1,2)));
/**
* printf style function for writing warnings.
*/