diff --git a/common.h b/common.h index b5026d8..77a89b5 100644 --- a/common.h +++ b/common.h @@ -33,6 +33,11 @@ typedef unsigned long int uintptr_t; #endif #if defined(HAVE_HTONS) +# if defined(HAVE_ARPA_INET_H) +# include +# elif defined(HAVE_NETINET_IN_H) +# include +# endif # define hton16 htons # define hton32 htonl #else diff --git a/cucul/font.c b/cucul/font.c index 78123d2..f887f99 100644 --- a/cucul/font.c +++ b/cucul/font.c @@ -22,11 +22,6 @@ # if defined(HAVE_ENDIAN_H) # include # endif -# if defined(HAVE_ARPA_INET_H) -# include -# elif defined(HAVE_NETINET_IN_H) -# include -# endif # if defined(HAVE_ERRNO_H) # include # endif diff --git a/cucul/import.c b/cucul/import.c index da7abde..a05c95b 100644 --- a/cucul/import.c +++ b/cucul/import.c @@ -22,11 +22,6 @@ # if defined(HAVE_ERRNO_H) # include # endif -# if defined(HAVE_ARPA_INET_H) -# include -# elif defined(HAVE_NETINET_IN_H) -# include -# endif # include # include # include @@ -39,14 +34,14 @@ static inline uint32_t sscanu32(void const *s) { uint32_t x; memcpy(&x, s, 4); - return ntohl(x); + return hton32(x); } static inline uint16_t sscanu16(void const *s) { uint16_t x; memcpy(&x, s, 2); - return ntohs(x); + return hton16(x); } /* ANSI Graphic Rendition Combination Mode */