Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-09-09 15:54:13 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-09 15:54:13 +0400
commit2b33c6b0b27c0a4fee5a1a405e012eb4032bba05 (patch)
tree286d9d2a6b9fd7fa03bb494c7789769fb4dbc3b5 /source
parentfe48e008e5b011bced5544818a1afc9a12ab98f4 (diff)
workaround for msvc not supporting variable length args in macros.
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesrna/RNA_access.h6
-rw-r--r--source/blender/makesrna/intern/rna_access.c5
2 files changed, 10 insertions, 1 deletions
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);