Provide the restrict keyword in all system components.

This commit is contained in:
Jonas 'Sortie' Termansen 2013-09-23 00:19:45 +02:00
parent bea3ed6f50
commit 8044afc7e8
1 changed files with 7 additions and 2 deletions

View File

@ -90,6 +90,11 @@
#endif
#endif
/* Provide the restrict keyword when building system components. */
#if __is_sortix_system_component && !defined(__want_restrict)
#define __want_restrict 1
#endif
/* Detect whether the restrict keyword is available. */
#if __STDC_VERSION__ >= 199901L
#define __HAS_RESTRICT 1
@ -103,8 +108,8 @@
#define __restrict restrict
#endif
/* Provide the restrict keyword when building the C library. */
#if !__HAS_RESTRICT && defined(__is_sortix_libc)
/* Provide the restrict keyword if requested and unavailable. */
#if !__HAS_RESTRICT && __want_restrict
#define restrict __restrict
#undef __HAS_RESTRICT
#define __HAS_RESTRICT 2