unbreak C89

This commit is contained in:
Sergio R. Caprile committed 2025-03-11 16:00:42 -03:00
1 parent b30cf6587c
commit 4eadf3699f
4 files changed
+22 -14

No files matched your search

+9
View File
@@ -19287,6 +19287,15 @@ uint64_t mg_millis(void) {
} }
#endif #endif
// network format equates big endian order
uint16_t mg_ntohs(uint16_t net) {
return MG_LOAD_BE16(&net);
}
uint32_t mg_ntohl(uint32_t net) {
return MG_LOAD_BE32(&net);
}
#ifdef MG_ENABLE_LINES #ifdef MG_ENABLE_LINES
#line 1 "src/wifi_dummy.c" #line 1 "src/wifi_dummy.c"
#endif #endif
+2 -7
View File
@@ -1147,13 +1147,8 @@ bool mg_path_is_sane(const struct mg_str path);
MG_U8P(p)[3] = (n) &255; \ MG_U8P(p)[3] = (n) &255; \
} while (0) } while (0)
// network format equates big endian order uint16_t mg_ntohs(uint16_t net);
static inline uint16_t mg_ntohs(uint16_t net) { uint32_t mg_ntohl(uint32_t net);
return MG_LOAD_BE16(&net);
}
static inline uint32_t mg_ntohl(uint32_t net) {
return MG_LOAD_BE32(&net);
}
#define mg_htons(x) mg_ntohs(x) #define mg_htons(x) mg_ntohs(x)
#define mg_htonl(x) mg_ntohl(x) #define mg_htonl(x) mg_ntohl(x)
+9
View File
@@ -184,3 +184,12 @@ uint64_t mg_millis(void) {
#endif #endif
} }
#endif #endif
// network format equates big endian order
uint16_t mg_ntohs(uint16_t net) {
return MG_LOAD_BE16(&net);
}
uint32_t mg_ntohl(uint32_t net) {
return MG_LOAD_BE32(&net);
}
+2 -7
View File
@@ -57,13 +57,8 @@ bool mg_path_is_sane(const struct mg_str path);
MG_U8P(p)[3] = (n) &255; \ MG_U8P(p)[3] = (n) &255; \
} while (0) } while (0)
// network format equates big endian order uint16_t mg_ntohs(uint16_t net);
static inline uint16_t mg_ntohs(uint16_t net) { uint32_t mg_ntohl(uint32_t net);
return MG_LOAD_BE16(&net);
}
static inline uint32_t mg_ntohl(uint32_t net) {
return MG_LOAD_BE32(&net);
}
#define mg_htons(x) mg_ntohs(x) #define mg_htons(x) mg_ntohs(x)
#define mg_htonl(x) mg_ntohl(x) #define mg_htonl(x) mg_ntohl(x)