diff options
author | Brian Paul <[email protected]> | 2008-10-15 13:55:18 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-10-15 13:55:18 -0600 |
commit | ddeec1ed10d6c12403fe8d30c072ea68f044db99 (patch) | |
tree | ae7b571024a8417986fcad8ee30c659af1628cee /src/gallium/drivers/cell/spu/spu_main.h | |
parent | 53951531ae7bfd64afae1ae55aac7f6ebd3fe4f5 (diff) |
cell: simplify spu debug code
Diffstat (limited to 'src/gallium/drivers/cell/spu/spu_main.h')
-rw-r--r-- | src/gallium/drivers/cell/spu/spu_main.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gallium/drivers/cell/spu/spu_main.h b/src/gallium/drivers/cell/spu/spu_main.h index ca72baea8b3..569b9e45d42 100644 --- a/src/gallium/drivers/cell/spu/spu_main.h +++ b/src/gallium/drivers/cell/spu/spu_main.h @@ -36,6 +36,19 @@ #include "pipe/p_state.h" +#if DEBUG +/* These debug macros use the unusual construction ", ##__VA_ARGS__" + * which expands to the expected comma + args if variadic arguments + * are supplied, but swallows the comma if there are no variadic + * arguments (which avoids syntax errors that would otherwise occur). + */ +#define D_PRINTF(flag, format,...) \ + if (spu.init.debug_flags & (flag)) \ + printf("SPU %u: " format, spu.init.id, ##__VA_ARGS__) +#else +#define D_PRINTF(...) +#endif + #define MAX_WIDTH 1024 #define MAX_HEIGHT 1024 @@ -187,8 +200,6 @@ struct spu_global extern struct spu_global spu; -extern boolean Debug; - |