summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2011-05-25 21:27:58 +0200
committerGuillem Jover <guillem@hadrons.org>2011-05-28 10:56:03 +0200
commite1f2a6f86906e2dd308a280ab832349eff4fe397 (patch)
tree9eb07d29c9da944ae9bdaa54a4f3c09636f03980
parent87dd203c26f2828de9506da5a0073aa0f6593c9e (diff)
Add new __packed, __aligned and __nonnull attributes
-rw-r--r--include/bsd/sys/cdefs.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/bsd/sys/cdefs.h b/include/bsd/sys/cdefs.h
index a1ea034..e91b660 100644
--- a/include/bsd/sys/cdefs.h
+++ b/include/bsd/sys/cdefs.h
@@ -65,6 +65,22 @@
# 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. */
@@ -86,6 +102,14 @@
# 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