Add NOTHS macro

This commit is contained in:
logicog
2026-04-22 22:36:26 +02:00
parent 14b45735e2
commit b53e7e1a06
+2
View File
@@ -1070,8 +1070,10 @@ __xdata struct uip_udp_conn *uip_udp_new(__xdata uip_ipaddr_t *ripaddr, __xdata
#ifndef HTONS
# if UIP_BYTE_ORDER == UIP_BIG_ENDIAN
# define HTONS(n) (n)
# define NTOHS(n) (n)
# else /* UIP_BYTE_ORDER == UIP_BIG_ENDIAN */
# define HTONS(n) (u16_t)((((u16_t) (n)) << 8) | (((u16_t) (n)) >> 8))
# define NTOHS(n) (u16_t)((((u16_t) (n)) << 8) | (((u16_t) (n)) >> 8))
# endif /* UIP_BYTE_ORDER == UIP_BIG_ENDIAN */
#else
#error "HTONS already defined!"