Compile with mingw64

This commit is contained in:
Tatsuhiro Tsujikawa 2022-07-05 18:10:57 +09:00
parent 2da1713200
commit 9a16e73813
1 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@
STIN uint32_t htonl(uint32_t hostlong) {
uint32_t res;
unsigned char *p = (unsigned char *)&res;
*p++ = hostlong >> 24;
*p++ = (unsigned char)(hostlong >> 24);
*p++ = (hostlong >> 16) & 0xffu;
*p++ = (hostlong >> 8) & 0xffu;
*p = hostlong & 0xffu;
@ -63,7 +63,7 @@ STIN uint32_t htonl(uint32_t hostlong) {
STIN uint16_t htons(uint16_t hostshort) {
uint16_t res;
unsigned char *p = (unsigned char *)&res;
*p++ = hostshort >> 8;
*p++ = (unsigned char)(hostshort >> 8);
*p = hostshort & 0xffu;
return res;
}