summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Dolezal <dolezj21@fel.cvut.cz>2014-11-20 15:00:29 +0100
committerGedare Bloom <gedare@rtems.org>2014-11-20 09:52:39 -0500
commitb2db1f5c76855332bd52b2cfb02c4c4a84e38f7d (patch)
tree61be4525d519ddec7d55eb7ef96f6f5f371e1ab2
parentd885b2b2137aeffdbbae586e9de4c014f784ca01 (diff)
downloadrtems-b2db1f5c76855332bd52b2cfb02c4c4a84e38f7d.tar.bz2
cpukit: basedefs: macro for packed attribute
-rw-r--r--cpukit/score/include/rtems/score/basedefs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/basedefs.h b/cpukit/score/include/rtems/score/basedefs.h
index 12480a8450..695ab8fa4f 100644
--- a/cpukit/score/include/rtems/score/basedefs.h
+++ b/cpukit/score/include/rtems/score/basedefs.h
@@ -197,6 +197,16 @@
#define RTEMS_COMPILER_UNUSED_ATTRIBUTE
#endif
+/**
+ * Instructs the compiler that a specific structure or union members will be
+ * placed so that the least memory is used.
+ */
+#if defined(__GNUC__)
+ #define RTEMS_COMPILER_PACKED_ATTRIBUTE __attribute__((packed))
+#else
+ #define RTEMS_COMPILER_PACKED_ATTRIBUTE
+#endif
+
#if __cplusplus >= 201103L
#define RTEMS_STATIC_ASSERT(cond, msg) \
static_assert(cond, # msg)