summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-07-17 22:15:35 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-07-17 22:15:35 -0700
commit77d7e603792756da519ae2b7b3de1131fd0e6819 (patch)
tree947f8dc3325fc0ee2ae73bd7c9dedc089cffe47b /src
parented86ef32b314f6eccde5a265ce90b1600edeb760 (diff)
Fix Clang/C2 compatibility
Clang/C2 does not implement __builtin_expect; additionally we need to work around deprecation warnings for fopen by disabling them.
Diffstat (limited to 'src')
-rw-r--r--src/pugixml.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index da4ecf9..b9e54fe 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -48,6 +48,11 @@
# pragma warning(disable: 4996) // this function or variable may be unsafe
#endif
+#if defined(_MSC_VER) && defined(__c2__)
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wdeprecated" // this function or variable may be unsafe
+#endif
+
#ifdef __INTEL_COMPILER
# pragma warning(disable: 177) // function was declared but never referenced
# pragma warning(disable: 279) // controlling expression is constant
@@ -81,7 +86,7 @@
#endif
// Branch weight controls
-#if defined(__GNUC__)
+#if defined(__GNUC__) && !defined(__c2__)
# define PUGI__UNLIKELY(cond) __builtin_expect(cond, 0)
#else
# define PUGI__UNLIKELY(cond) (cond)
@@ -12594,6 +12599,10 @@ namespace pugi
# pragma warning(pop)
#endif
+#if defined(_MSC_VER) && defined(__c2__)
+# pragma clang diagnostic pop
+#endif
+
// Undefine all local macros (makes sure we're not leaking macros in header-only mode)
#undef PUGI__NO_INLINE
#undef PUGI__UNLIKELY