summaryrefslogtreecommitdiff
path: root/ports/esp8266/posix_helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/esp8266/posix_helpers.c')
-rw-r--r--ports/esp8266/posix_helpers.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ports/esp8266/posix_helpers.c b/ports/esp8266/posix_helpers.c
index 1c20c8b0b..adb0145e7 100644
--- a/ports/esp8266/posix_helpers.c
+++ b/ports/esp8266/posix_helpers.c
@@ -55,14 +55,13 @@ void *realloc(void *ptr, size_t size) {
return p;
}
-#define PLATFORM_HTONL(_n) ((uint32_t)( (((_n) & 0xff) << 24) | (((_n) & 0xff00) << 8) | (((_n) >> 8) & 0xff00) | (((_n) >> 24) & 0xff) ))
#undef htonl
#undef ntohl
uint32_t ntohl(uint32_t netlong) {
- return PLATFORM_HTONL(netlong);
+ return MP_BE32TOH(netlong);
}
uint32_t htonl(uint32_t netlong) {
- return PLATFORM_HTONL(netlong);
+ return MP_HTOBE32(netlong);
}
time_t time(time_t *t) {