gstmacros.h: Fix check for 'restrict' keyword
authorNirbheek Chauhan <nirbheek@centricular.com>
Tue, 19 Feb 2019 19:55:11 +0000 (01:25 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Tue, 19 Feb 2019 19:55:11 +0000 (01:25 +0530)
MSVC also defines it as a keyword. Fixes build errors in projects that
include MSVC's xkeycheck.h which ensures that keywords aren't overriden
with a define.

gst/gstmacros.h

index 53cf6cf..5c0815e 100644 (file)
@@ -41,7 +41,8 @@ G_BEGIN_DECLS
 # undef GST_CAN_INLINE
 #endif
 
-#if (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) && !defined(restrict)
+/* MSVC defines 'restrict' as a keyword and not a define */
+#if (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) && !defined(_MSC_VER) && !defined(restrict)
 #  if defined(__GNUC__) && __GNUC__ >= 4
 #    define restrict __restrict__
 #  else