]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
Add new __packed, __aligned and __nonnull attributes
authorGuillem Jover <guillem@hadrons.org>
Wed, 25 May 2011 19:27:58 +0000 (21:27 +0200)
committerGuillem Jover <guillem@hadrons.org>
Sat, 28 May 2011 08:56:03 +0000 (10:56 +0200)
include/bsd/sys/cdefs.h

index a1ea034ee8bd5fd42ed256c969c6dd68dbe91c09..e91b66012566276c5e79d66bd32299b0a6a48e69 100644 (file)
 # endif
 #endif
 
+#ifndef __packed
+# if LIBBSD_GCC_VERSION >= 0x0207
+#  define __packed __attribute__((__packed__))
+# else
+#  define __packed
+# endif
+#endif
+
+#ifndef __aligned
+# if LIBBSD_GCC_VERSION >= 0x0207
+#  define __aligned(x) __attribute__((__aligned__(x)))
+# else
+#  define __aligned(x)
+# endif
+#endif
+
 /* Linux headers define a struct with a member names __unused.
  * Debian bugs: #522773 (linux), #522774 (libc).
  * Disable for now. */
 # endif
 #endif
 
+#ifndef __nonnull
+# if LIBBSD_GCC_VERSION >= 0x0302
+#  define __nonnull(x) __attribute__((__nonnull__(x)))
+# else
+#  define __nonnull(x)
+# endif
+#endif
+
 #ifndef __bounded__
 # define __bounded__(x, y, z)
 #endif