mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-28 03:27:46 +08:00
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 3c75fac130b5. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
3c75fac130
commit
e66c63be6b
@ -423,6 +423,19 @@
|
|||||||
#define __restrict
|
#define __restrict
|
||||||
#endif
|
#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
|
* GNU C version 2.96 adds explicit branch prediction so that
|
||||||
* the CPU back-end can hint the processor and also so that
|
* the CPU back-end can hint the processor and also so that
|
||||||
|
Loading…
x
Reference in New Issue
Block a user