mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-06 22:44:38 +08:00
Provide struct packing macros on GCC/clang out of the box
This commit is contained in:
parent
c1258e5c72
commit
3a8368ef04
@ -211,7 +211,7 @@ extern "C" {
|
||||
/** Packed structs support.
|
||||
* Placed BEFORE declaration of a packed struct.\n
|
||||
* For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n
|
||||
* Porting to GCC/clang: Nothing to do.
|
||||
* A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
|
||||
*/
|
||||
#ifndef PACK_STRUCT_BEGIN
|
||||
#define PACK_STRUCT_BEGIN
|
||||
@ -220,7 +220,7 @@ extern "C" {
|
||||
/** Packed structs support.
|
||||
* Placed AFTER declaration of a packed struct.\n
|
||||
* For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n
|
||||
* Porting to GCC/clang: Nothing to do.
|
||||
* A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
|
||||
*/
|
||||
#ifndef PACK_STRUCT_END
|
||||
#define PACK_STRUCT_END
|
||||
@ -229,16 +229,20 @@ extern "C" {
|
||||
/** Packed structs support.
|
||||
* Placed between end of declaration of a packed struct and trailing semicolon.\n
|
||||
* For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n
|
||||
* Porting to GCC/clang: \#define PACK_STRUCT_STRUCT \_\_attribute\_\_((packed))
|
||||
* A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
|
||||
*/
|
||||
#ifndef PACK_STRUCT_STRUCT
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define PACK_STRUCT_STRUCT __attribute__((packed))
|
||||
#else
|
||||
#define PACK_STRUCT_STRUCT
|
||||
#endif
|
||||
#endif /* PACK_STRUCT_STRUCT */
|
||||
|
||||
/** Packed structs support.
|
||||
* Wraps u32_t and u16_t members.\n
|
||||
* For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n
|
||||
* Porting to GCC/clang: Nothing to do.
|
||||
* A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
|
||||
*/
|
||||
#ifndef PACK_STRUCT_FIELD
|
||||
#define PACK_STRUCT_FIELD(x) x
|
||||
@ -247,7 +251,7 @@ extern "C" {
|
||||
/** Packed structs support.
|
||||
* Wraps u8_t members, where some compilers warn that packing is not necessary.\n
|
||||
* For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n
|
||||
* Porting to GCC/clang: Nothing to do.
|
||||
* A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
|
||||
*/
|
||||
#ifndef PACK_STRUCT_FLD_8
|
||||
#define PACK_STRUCT_FLD_8(x) PACK_STRUCT_FIELD(x)
|
||||
@ -256,7 +260,7 @@ extern "C" {
|
||||
/** Packed structs support.
|
||||
* Wraps members that are packed structs themselves, where some compilers warn that packing is not necessary.\n
|
||||
* For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n
|
||||
* Porting to GCC/clang: Nothing to do.
|
||||
* A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here.
|
||||
*/
|
||||
#ifndef PACK_STRUCT_FLD_S
|
||||
#define PACK_STRUCT_FLD_S(x) PACK_STRUCT_FIELD(x)
|
||||
|
Loading…
x
Reference in New Issue
Block a user