Mesa (master): util: add MSVC HAS_TRIVIAL_DESTRUCTOR implementation

Brian Paul brianp at kemper.freedesktop.org
Wed Nov 9 21:56:53 UTC 2016


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

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Nov  9 14:48:45 2016 -0700

util: add MSVC HAS_TRIVIAL_DESTRUCTOR implementation

Based on a patch by George Kyriazis but changed to test for
_MSC_VER >= 1800 (Visual Studio 2015).

This fixes the failed CANARY assertion in src/util/ralloc.c:get_header()
on Windows.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98595
Tested-by: Brian Paul <brianp at vmware.com>
Signed-off-by: Brian Paul <brianp at vmware.com>

---

 src/util/macros.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/util/macros.h b/src/util/macros.h
index 27d1b62..0563fa5 100644
--- a/src/util/macros.h
+++ b/src/util/macros.h
@@ -175,6 +175,11 @@ do {                       \
 #      if __has_feature(has_trivial_destructor)
 #         define HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
 #      endif
+#   elif defined(_MSC_VER) && !defined(__INTEL_COMPILER)
+#      if _MSC_VER >= 1800
+#         define HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
+#      else
+#      endif
 #   endif
 #   ifndef HAS_TRIVIAL_DESTRUCTOR
        /* It's always safe (if inefficient) to assume that a




More information about the mesa-commit mailing list