Mesa (master): nir: no-op C99 _Pragma() with MSVC

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Nov 23 17:36:28 UTC 2019


Module: Mesa
Branch: master
Commit: a2689ebcd68ccf9b3bcbf9bae926c70beccd6a11
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a2689ebcd68ccf9b3bcbf9bae926c70beccd6a11

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Nov 22 19:42:34 2019 -0700

nir: no-op C99 _Pragma() with MSVC

This fixes a build failure on MSVC.

BTW, it looks like clang supports _Pragma() but I don't know if it
understands the "gcc unroll N" directive.

Signed-off-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/compiler/nir/nir_range_analysis.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/compiler/nir/nir_range_analysis.c b/src/compiler/nir/nir_range_analysis.c
index df5d4dab9af..d38bcc0b040 100644
--- a/src/compiler/nir/nir_range_analysis.c
+++ b/src/compiler/nir/nir_range_analysis.c
@@ -218,6 +218,13 @@ analyze_constant(const struct nir_alu_instr *instr, unsigned src,
  */
 #define _______ unknown
 
+
+/* MSVC doesn't have C99's _Pragma() */
+#ifdef _MSC_VER
+#define _Pragma(x)
+#endif
+
+
 #ifndef NDEBUG
 #define ASSERT_TABLE_IS_COMMUTATIVE(t)                        \
    do {                                                       \




More information about the mesa-commit mailing list