We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f5b10c4 commit 576a778Copy full SHA for 576a778
cbits/swap.c
@@ -0,0 +1,16 @@
1
+#include <netinet/in.h>
2
+
3
+static uint32_t my_htonl(uint32_t x) { return htonl(x); }
4
+static uint16_t my_htons(uint16_t x) { return htons(x); }
5
+static uint32_t my_ntohl(uint32_t x) { return ntohl(x); }
6
+static uint32_t my_ntohs(uint16_t x) { return ntohs(x); }
7
8
+#undef htonl
9
+#undef htons
10
+#undef ntohl
11
+#undef ntohs
12
13
+uint32_t htonl(uint32_t x) { return my_htonl(x); }
14
+uint32_t htons(uint16_t x) { return my_htons(x); }
15
+uint32_t ntohl(uint32_t x) { return my_ntohl(x); }
16
+uint32_t ntohs(uint16_t x) { return my_ntohs(x); }
network.cabal
@@ -176,6 +176,9 @@ library
176
temporary
177
178
if os(haiku)
179
+ c-sources:
180
+ cbits/swap.c
181
182
extra-libraries:
183
network
184
0 commit comments