From: Sebastian Dröge Date: Tue, 19 Oct 2010 13:52:30 +0000 (+0200) Subject: macros: Define restrict keyword if not available X-Git-Tag: RELEASE-0.10.32~285 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a797b9f22bf548ff5caa70d670d26aaaade6540e;p=platform%2Fupstream%2Fgstreamer.git macros: Define restrict keyword if not available This change always defines the restrict keyword if a non-C99 C compiler is used. In the case of GCC >= 4 it will be defined to __restrict__, in all other cases to nothing. This allows to use the restrict keyword unconditionally. --- diff --git a/gst/gstmacros.h b/gst/gstmacros.h index cc031e4..e38af539 100644 --- a/gst/gstmacros.h +++ b/gst/gstmacros.h @@ -39,6 +39,14 @@ G_BEGIN_DECLS # undef GST_CAN_INLINE #endif +#if (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) && !defined(restrict) +# if defined(__GNUC__) && __GNUC__ >= 4 +# define restrict __restrict__ +# else +# define restrict +# endif +#endif + G_END_DECLS #endif /* __GST_MACROS_H__ */