]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: add restrict keyword fallback
authorKarel Zak <kzak@redhat.com>
Fri, 22 Jan 2021 12:28:02 +0000 (13:28 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 22 Jan 2021 12:28:02 +0000 (13:28 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
include/c.h

index ae08131099a079d3bd50579233c951ebea302c70..6b742512b3d62464ebb344ce6efaf82c623819a1 100644 (file)
 # define ignore_result(x) ((void) (x))
 #endif /* !__GNUC__ */
 
+
+/* "restrict" keyword fallback */
+#if __STDC__ != 1
+# define restrict __restrict /* use implementation __ format */
+#else
+# ifndef __STDC_VERSION__
+#  define restrict __restrict /* use implementation __ format */
+# else
+#  if __STDC_VERSION__ < 199901L
+#   define restrict __restrict /* use implementation __ format */
+#  endif
+# endif
+#endif
+
+
 /*
  * It evaluates to 1 if the attribute/feature is supported by the current
  * compilation target. Fallback for old compilers.