mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-21 19:51:50 +00:00
unbreak VC98 weird 64-bit handling
This commit is contained in:
1 parent
5b6c08acfb
commit
4d8831f2b6
2 files changed
+8
-4
No files matched your search
+4
-2
@@ -30560,9 +30560,11 @@ static size_t mkhdr(size_t len, int op, bool is_client, uint8_t *buf) {
|
|||||||
} else {
|
} else {
|
||||||
uint32_t tmp;
|
uint32_t tmp;
|
||||||
buf[1] = 127;
|
buf[1] = 127;
|
||||||
tmp = mg_htonl((uint32_t) (((uint64_t) len) >> 32));
|
tmp = (sizeof(len) <= sizeof(uint32_t) || len <= 0xffffffffU)
|
||||||
|
? 0 // avoid some 32-bit platforms breaking it (VC98)
|
||||||
|
: mg_htonl((uint32_t) ((uint64_t) len >> 32));
|
||||||
memcpy(&buf[2], &tmp, sizeof(tmp));
|
memcpy(&buf[2], &tmp, sizeof(tmp));
|
||||||
tmp = mg_htonl((uint32_t) (len & 0xffffffffU));
|
tmp = mg_htonl((uint32_t) len);
|
||||||
memcpy(&buf[6], &tmp, sizeof(tmp));
|
memcpy(&buf[6], &tmp, sizeof(tmp));
|
||||||
n = 10;
|
n = 10;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,9 +109,11 @@ static size_t mkhdr(size_t len, int op, bool is_client, uint8_t *buf) {
|
|||||||
} else {
|
} else {
|
||||||
uint32_t tmp;
|
uint32_t tmp;
|
||||||
buf[1] = 127;
|
buf[1] = 127;
|
||||||
tmp = mg_htonl((uint32_t) (((uint64_t) len) >> 32));
|
tmp = (sizeof(len) <= sizeof(uint32_t) || len <= 0xffffffffU)
|
||||||
|
? 0 // avoid some 32-bit platforms breaking it (VC98)
|
||||||
|
: mg_htonl((uint32_t) ((uint64_t) len >> 32));
|
||||||
memcpy(&buf[2], &tmp, sizeof(tmp));
|
memcpy(&buf[2], &tmp, sizeof(tmp));
|
||||||
tmp = mg_htonl((uint32_t) (len & 0xffffffffU));
|
tmp = mg_htonl((uint32_t) len);
|
||||||
memcpy(&buf[6], &tmp, sizeof(tmp));
|
memcpy(&buf[6], &tmp, sizeof(tmp));
|
||||||
n = 10;
|
n = 10;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user