summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--giscanner/ccompiler.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
index 35549da2..4ad572c3 100644
--- a/giscanner/ccompiler.py
+++ b/giscanner/ccompiler.py
@@ -444,6 +444,13 @@ class CCompiler(object):
else:
macro_name = macro[:macro_index]
macro_value = macro[macro_index + 1:]
+
+ # Somehow the quotes used in defining
+ # macros for compiling using distutils
+ # get dropped for MSVC builds, so
+ # escape the escape character.
+ if isinstance(self.compiler, MSVCCompiler):
+ macro_value = macro_value.replace('\"', '\\\"')
macros.append((macro_name, macro_value))
elif option.startswith('-U'):
macros.append((option[len('-U'):],))