diff --git a/cbits/swap.c b/cbits/swap.c new file mode 100644 index 00000000..8533880d --- /dev/null +++ b/cbits/swap.c @@ -0,0 +1,16 @@ +#include + +static uint32_t my_htonl(uint32_t x) { return htonl(x); } +static uint16_t my_htons(uint16_t x) { return htons(x); } +static uint32_t my_ntohl(uint32_t x) { return ntohl(x); } +static uint32_t my_ntohs(uint16_t x) { return ntohs(x); } + +#undef htonl +#undef htons +#undef ntohl +#undef ntohs + +uint32_t htonl(uint32_t x) { return my_htonl(x); } +uint32_t htons(uint16_t x) { return my_htons(x); } +uint32_t ntohl(uint32_t x) { return my_ntohl(x); } +uint32_t ntohs(uint16_t x) { return my_ntohs(x); } diff --git a/network.cabal b/network.cabal index 1708dc40..611c88f2 100644 --- a/network.cabal +++ b/network.cabal @@ -176,6 +176,9 @@ library temporary if os(haiku) + c-sources: + cbits/swap.c + extra-libraries: network