Browse Source

Fix compilation error on windows (#2118)

afunix.h uses types declared in winsock2.h, and so has to be included
after it. Including afunix.h first will result in a somewhat unhelpful
compilation error:

error C3646: 'sun_family': unknown override specifier

Signed-off-by: Piotr Stankiewicz <[email protected]>
Piotr 8 months ago
parent
commit
dbc4af819a
1 changed files with 3 additions and 1 deletions
  1. 3 1
      httplib.h

+ 3 - 1
httplib.h

@@ -184,11 +184,13 @@ using ssize_t = long;
 #define NOMINMAX
 #endif // NOMINMAX
 
-#include <afunix.h>
 #include <io.h>
 #include <winsock2.h>
 #include <ws2tcpip.h>
 
+// afunix.h uses types declared in winsock2.h, so has to be included after it.
+#include <afunix.h>
+
 #ifndef WSA_FLAG_NO_HANDLE_INHERIT
 #define WSA_FLAG_NO_HANDLE_INHERIT 0x80
 #endif