summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-11-09 14:48:45 -0700
committerBrian Paul <[email protected]>2016-11-09 14:55:10 -0700
commit5b92008ae279962dc09bcf98c9e5511a325a2bd9 (patch)
treea83d1b2b2b94ede92c69ddee53ce9a36486e00d0 /src
parent0f434a68a39f391795dff92c317349d28dd2e638 (diff)
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 <[email protected]> Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/util/macros.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util/macros.h b/src/util/macros.h
index 27d1b6292fa..0563fa59b59 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