[rtems commit] cpukit: basedefs: macro for packed attribute

Gedare Bloom gedare at rtems.org
Thu Nov 20 14:53:05 UTC 2014


Module:    rtems
Branch:    master
Commit:    b2db1f5c76855332bd52b2cfb02c4c4a84e38f7d
Changeset: http://git.rtems.org/rtems/commit/?id=b2db1f5c76855332bd52b2cfb02c4c4a84e38f7d

Author:    Jan Dolezal <dolezj21 at fel.cvut.cz>
Date:      Thu Nov 20 15:00:29 2014 +0100

cpukit: basedefs: macro for packed attribute

---

 cpukit/score/include/rtems/score/basedefs.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/cpukit/score/include/rtems/score/basedefs.h b/cpukit/score/include/rtems/score/basedefs.h
index 12480a8..695ab8f 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)



More information about the vc mailing list