sys/cdefs.h: introduce __restrict_arr, as in glibc
C99 allows to define arrays as non-overlappiung using the restrict
keyword. This is supported by GCC 3.1 and later, but it's not
allowed in C++.
This is in preparation of fixing a Cygwin build problem introduce by
commit 3c75fac130
.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
3c75fac130
commit
e66c63be6b
1 changed files with 13 additions and 0 deletions
|
@ -423,6 +423,19 @@
|
|||
#define __restrict
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Additionally, we allow to use `__restrict_arr' for declaring arrays as
|
||||
* non-overlapping per C99. That's supported since gcc 3.1, but it's not
|
||||
* allowed in C++.
|
||||
*/
|
||||
#if defined(__cplusplus) || !__GNUC_PREREQ__(3, 1)
|
||||
#define __restrict_arr
|
||||
#elif defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
|
||||
#define __restrict_arr restrict
|
||||
#else
|
||||
#define __restrict_arr
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GNU C version 2.96 adds explicit branch prediction so that
|
||||
* the CPU back-end can hint the processor and also so that
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue