diff options
author | Aapo Tahkola <aet@rasterburn.org> | 2005-02-08 04:31:29 +0000 |
---|---|---|
committer | Aapo Tahkola <aet@rasterburn.org> | 2005-02-08 04:31:29 +0000 |
commit | 315afce941a7247ecf79da520d974a59534e8779 (patch) | |
tree | f19faa58f13f462003667de15d03d1c3480607ff /src/mesa/drivers/dri/r300/r300_context.h | |
parent | 3f847b73f3f480eb823f58e73edf53c2a5317a55 (diff) | |
download | external_mesa3d-315afce941a7247ecf79da520d974a59534e8779.zip external_mesa3d-315afce941a7247ecf79da520d974a59534e8779.tar.gz external_mesa3d-315afce941a7247ecf79da520d974a59534e8779.tar.bz2 |
Implemented checks that prevent r300 from locking up when bad number of verts are given. Also tweaked WARN_ONCE a bit to handle va-args.
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_context.h')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_context.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 54cc7e3..428614b 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -56,13 +56,17 @@ typedef struct r300_context *r300ContextPtr; /* Checkpoint.. for convenience */ #define CPT { fprintf(stderr, "%s:%s line %d\n", __FILE__, __FUNCTION__, __LINE__); } -#define WARN_ONCE(a) { \ +/* 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__){ \ fprintf(stderr, "*********************************WARN_ONCE*********************************\n"); \ fprintf(stderr, "File %s function %s line %d\n", \ __FILE__, __FUNCTION__, __LINE__); \ - fprintf(stderr, a);\ + fprintf(stderr, a, ## __VA_ARGS__);\ fprintf(stderr, "***************************************************************************\n"); \ warn##__LINE__=0;\ } \ |