differ between >=3.3 and below at certain options
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 26 Dec 2003 00:20:08 +0000 (00:20 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 26 Dec 2003 00:20:08 +0000 (00:20 +0000)
added 'restrict' workarounds

git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@472 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/compat.h

index e22641f..125d875 100644 (file)
 #if defined(__GNUC__)
 #  define UNUSED                __attribute__((__unused__))
 #  define NORETURN              __attribute__((__noreturn__))
-#  if __GNUC__ >= 3
+#  if __GNUC__>3 || (__GNUC__==3 && __GNUC__MINOR>=3)
+#    define NONNULL(ARGS)      __attribute__((__nonnull__ ARGS))
 #    define ALWAYSINLINE        __attribute__((__always_inline__))
 #  else
+#    define NONNULL(ARGS)
 #    define ALWAYSINLINE
 #  endif
 #else
+#  define NONNULL(ARGS)
 #  define UNUSED
 #  define NORETURN
 #  define ALWAYSINLINE
 #endif
 
+#if !defined(__STDC_VERSION__) || (__STDC_VERSION__<199901L)
+#  define restrict
+#endif
+
 #if !defined(HAVE_DECL_MS_MOVE) || !(HAVE_DECL_MS_MOVE)
   // from <linux/fs.h>
 #  define MS_MOVE              8192