On 03/14/2013 11:41 AM, jfons...@vmware.com wrote:
From: José Fonseca<jfons...@vmware.com>

scons/llvm.py defines inline globally to workaround issues with LLVM C
binding headers, so the only way to is to avoid
aggravating xkeycheck.h errors is to set _ALLOW_KEYWORD_MACROS.

This fixes MSVC 2012 build with LLVM.
---
  include/c99_compat.h |    8 +++-----
  scons/gallium.py     |    1 +
  2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/include/c99_compat.h b/include/c99_compat.h
index 3a9f502..429c601 100644
--- a/include/c99_compat.h
+++ b/include/c99_compat.h
@@ -37,12 +37,10 @@
      * Visual Studio 2012 will complain if we define the `inline` keyword, but
      * actually it only supports the keyword on C++.
      *
-    * We could skip this check by defining _ALLOW_KEYWORD_MACROS, but there is
-    * probably value in checking this for other keywords.  So simply include
-    * the checking before we define it below.
+    * To avoid this the _ALLOW_KEYWORD_MACROS must be set.
      */
-#  if _MSC_VER>= 1700
-#    include<xkeycheck.h>
+#  if (_MSC_VER>= 1700)&&  !defined(_ALLOW_KEYWORD_MACROS)
+#    define _ALLOW_KEYWORD_MACROS
  #  endif

     /*
diff --git a/scons/gallium.py b/scons/gallium.py
index 4b51b6e..4d3de82 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -289,6 +289,7 @@ def generate(env):
                  '_CRT_SECURE_NO_DEPRECATE',
                  '_SCL_SECURE_NO_WARNINGS',
                  '_SCL_SECURE_NO_DEPRECATE',
+                '_ALLOW_KEYWORD_MACROS',
              ]
          if env['build'] in ('debug', 'checked'):
              cppdefines += ['_DEBUG']

Reviewed-by: Brian Paul <bri...@vmware.com>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to