diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2010-12-13 16:25:31 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2010-12-13 16:26:06 -0800 |
commit | 1870ec9ce40e8852e1cdce473afa90d21d780e52 (patch) | |
tree | 469f3919af21cbba882cca2d4e44aa4c59383ff3 | |
parent | e5604f04482350eb922a31ad4342aab91ab3b412 (diff) |
Xfuncproto.h: Add _X_RESTRICT_KEYWORD for C99 & gcc in non-strict-C89 mode
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | Xfuncproto.h.in | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Xfuncproto.h.in b/Xfuncproto.h.in index b624956..fd9f29b 100644 --- a/Xfuncproto.h.in +++ b/Xfuncproto.h.in @@ -128,4 +128,16 @@ in this Software without prior written authorization from The Open Group. # define _X_ATTRIBUTE_PRINTF(x,y) #endif +/* C99 keyword "restrict" or equivalent extensions in pre-C99 compilers */ +#ifndef _X_RESTRICT_KYWD +# if defined(restrict) /* assume autoconf set it correctly */ || \ + (defined(__STDC__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */ +# define _X_RESTRICT_KYWD restrict +# elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */ +# define _X_RESTRICT_KYWD __restrict__ +# else +# define _X_RESTRICT_KYWD +# endif +#endif + #endif /* _XFUNCPROTO_H_ */ |