inet_* functions on Windows
Unfortunately, these headers are "interesting" on Windows. They
absolutely have to be included prior to <windows.h> which is included
from other system headers (nu surprise there). In some earlier version
of this patch this was not a problem, but I suspect that our
config.h-ification for the `LIBYANG_API_{DEF,DECL}` made stuff more
complex :(.
TL;DR: make sure that our "compat.h" goes in first, otherwise Bad
Things™ happen.
diff --git a/src/config.h.in b/src/config.h.in
index 4f53f2e..af3d1f0 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -15,6 +15,12 @@
#ifndef LY_CONFIG_H_
#define LY_CONFIG_H_
+#ifdef _WIN32
+/* headers are broken on Windows, which means that some of them simply *have* to come first */
+# include <winsock2.h>
+# include <ws2tcpip.h>
+#endif
+
/** size of fixed_mem in lyd_value, minimum is 8 (B) */
#define LYD_VALUE_FIXED_MEM_SIZE @LYD_VALUE_SIZE@