mirror of https://github.com/ARMmbed/mbed-os.git
Changed MBED_PACKED to a macro
Supports both __packed and __attribute__((packed)) styles of attriubtes MBED_PACKED(struct) foo { blablabla };pull/1784/head
parent
a08d04c751
commit
5cdb151193
|
@ -34,17 +34,17 @@
|
|||
* @code
|
||||
* #include "toolchain.h"
|
||||
*
|
||||
* typedef struct {
|
||||
* MBED_PACKED(struct) foo {
|
||||
* char x;
|
||||
* int y;
|
||||
* } MBED_PACKED foo;
|
||||
* };
|
||||
* @endcode
|
||||
*/
|
||||
#ifndef MBED_PACKED
|
||||
#if defined(__ICCARM__)
|
||||
#define MBED_PACKED __packed
|
||||
#define MBED_PACKED(struct) __packed struct
|
||||
#else
|
||||
#define MBED_PACKED __attribute__((packed))
|
||||
#define MBED_PACKED(struct) struct __attribute__((packed))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -238,16 +238,11 @@ typedef int FILEHANDLE;
|
|||
#endif
|
||||
|
||||
#ifndef PACKED
|
||||
#define PACKED MBED_PACKED
|
||||
#define PACKED MBED_PACKED()
|
||||
#endif
|
||||
|
||||
#ifndef EXTERN
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
// Backwards compatibility
|
||||
#ifndef EXTERN
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue