about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--misc/sys/cdefs.h13
2 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e19e415c44..62e2718fa3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2018-02-06  Joseph Myers  <joseph@codesourcery.com>
 
+	[BZ #17721]
+	* misc/sys/cdefs.h [!__GNUC__ && (__cplusplus || (__STDC_VERSION__
+	&& __STDC_VERSION__ >= 199901L))] (__inline): Define to inline.
+	[!__GNUC_PREREQ (2,92) && __STDC_VERSION__ && __STDC_VERSION__ >=
+	199901L] (__restrict): Define to restrict.
+
 	[BZ #19667]
 	* string/testcopy.c: Include <support/support.h>.  Do not include
 	<malloc.h>.  Use <support/test-driver.c>.
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index af103fdb8a..e80a45ca68 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -72,7 +72,12 @@
 
 #else	/* Not GCC.  */
 
-# define __inline		/* No inline functions.  */
+# if (defined __cplusplus						\
+      || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
+#  define __inline	inline
+# else
+#  define __inline		/* No inline functions.  */
+# endif
 
 # define __THROW
 # define __THROWNL
@@ -368,7 +373,11 @@
 
 /* __restrict is known in EGCS 1.2 and above. */
 #if !__GNUC_PREREQ (2,92)
-# define __restrict	/* Ignore */
+# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+#  define __restrict	restrict
+# else
+#  define __restrict	/* Ignore */
+# endif
 #endif
 
 /* ISO C99 also allows to declare arrays as non-overlapping.  The syntax is