mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-28 20:58:31 +00:00
Fix IP fragmentation checks for big-endian CPUs
This commit is contained in:
1 parent
5af2de635e
commit
93dd7a85f6
6 files changed
+61
-55
No files matched your search
+10
-1
@@ -472,7 +472,7 @@ typedef enum { false = 0, true = 1 } bool;
|
||||
#pragma comment(lib, "advapi32.lib")
|
||||
#else
|
||||
#include <bcrypt.h>
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma comment(lib, "bcrypt.lib")
|
||||
#endif
|
||||
#endif
|
||||
@@ -1112,6 +1112,15 @@ bool mg_path_is_sane(const struct mg_str path);
|
||||
#define MG_IPADDR_PARTS(ADDR) \
|
||||
MG_U8P(ADDR)[0], MG_U8P(ADDR)[1], MG_U8P(ADDR)[2], MG_U8P(ADDR)[3]
|
||||
|
||||
#define MG_LOAD_BE16(p) ((uint16_t) ((MG_U8P(p)[0] << 8U) | MG_U8P(p)[1]))
|
||||
#define MG_LOAD_BE24(p) \
|
||||
((uint32_t) ((MG_U8P(p)[0] << 16U) | (MG_U8P(p)[1] << 8U) | MG_U8P(p)[2]))
|
||||
#define MG_STORE_BE16(p, n) \
|
||||
do { \
|
||||
MG_U8P(p)[0] = ((n) >> 8U) & 255; \
|
||||
MG_U8P(p)[1] = (n) &255; \
|
||||
} while (0)
|
||||
|
||||
#define MG_REG(x) ((volatile uint32_t *) (x))[0]
|
||||
#define MG_BIT(x) (((uint32_t) 1U) << (x))
|
||||
#define MG_SET_BITS(R, CLRMASK, SETMASK) (R) = ((R) & ~(CLRMASK)) | (SETMASK)
|
||||
|
||||
Reference in new issue
Block a user