From 2b33c6b0b27c0a4fee5a1a405e012eb4032bba05 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 9 Sep 2011 11:54:13 +0000 Subject: workaround for msvc not supporting variable length args in macros. --- source/blender/makesrna/RNA_access.h | 6 +++++- source/blender/makesrna/intern/rna_access.c | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 7d013d01e72..8af4fe7b76b 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -976,7 +976,11 @@ StructRNA *ID_code_to_RNA_type(short idcode); /* macro which inserts the function name */ -#define RNA_warning(format, args...) _RNA_warning("%s: " format "\n", __func__, ##args) +#ifdef __GNUC__ +# define RNA_warning(format, args...) _RNA_warning("%s: " format "\n", __func__, ##args) +#else /* MSVC doesnt support variable length args in macros */ +# define RNA_warning _RNA_warning +#endif void _RNA_warning(const char *format, ...) #ifdef __GNUC__ diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index ea23fea0c2c..1ccd6d9a1d7 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -5383,6 +5383,11 @@ void _RNA_warning(const char *format, ...) vprintf(format, args); va_end(args); + /* gcc macro adds '\n', but cant use for other compilers */ +#ifndef __GNUC__ + fputc('\n', stdout); +#endif + #ifdef WITH_PYTHON { extern void PyC_LineSpit(void); -- cgit v1.2.3