workaround for msvc not supporting variable length args in macros.

This commit is contained in:
Campbell Barton 2011-09-09 11:54:13 +00:00
parent fe48e008e5
commit 2b33c6b0b2
2 changed files with 10 additions and 1 deletions

@ -976,7 +976,11 @@ StructRNA *ID_code_to_RNA_type(short idcode);
/* macro which inserts the function name */ /* 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, ...) void _RNA_warning(const char *format, ...)
#ifdef __GNUC__ #ifdef __GNUC__

@ -5383,6 +5383,11 @@ void _RNA_warning(const char *format, ...)
vprintf(format, args); vprintf(format, args);
va_end(args); va_end(args);
/* gcc macro adds '\n', but cant use for other compilers */
#ifndef __GNUC__
fputc('\n', stdout);
#endif
#ifdef WITH_PYTHON #ifdef WITH_PYTHON
{ {
extern void PyC_LineSpit(void); extern void PyC_LineSpit(void);