Cleanup hton*/ntoh* function handling and platform abstraction

Let lwip use functions/macros prefixed by lwip_ internally to avoid naming clashes with external #includes.
Remove over-complicated #define handling in def.h
Make functions easier to override in cc.h. The following is sufficient now (no more LWIP_PLATFORM_BYTESWAP):
#define lwip_htons(x) <your_htons>
#define lwip_htonl(x) <your_htonl>
This commit is contained in:
Dirk Ziegelmeier
2016-10-06 12:55:57 +02:00
parent 0c06073819
commit 13fb616bb2
44 changed files with 370 additions and 426 deletions

View File

@@ -84,7 +84,7 @@ typedef union
#define eui64_set32(e, l) do { \
(e).e32[0] = 0; \
(e).e32[1] = htonl(l); \
(e).e32[1] = lwip_htonl(l); \
} while (0)
#define eui64_setlo32(e, l) eui64_set32(e, l)

View File

@@ -59,7 +59,7 @@
* This is not nice ... the alternative is a bitfield struct though.
* And unfortunately, we cannot share the same bits for the option
* names above since C and H are the same bit. We could do a u_int32
* but then we have to do a htonl() all the time and/or we still need
* but then we have to do a lwip_htonl() all the time and/or we still need
* to know which octet is which.
*/
#define MPPE_C_BIT 0x01 /* MPPC */