Skip to content

Commit 82a4c73

Browse files
author
Piotr Stankiewicz
committed
Fix compilation error on windows
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]>
1 parent 7dbf547 commit 82a4c73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

httplib.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,13 @@ using ssize_t = long;
184184
#define NOMINMAX
185185
#endif // NOMINMAX
186186

187-
#include <afunix.h>
188187
#include <io.h>
189188
#include <winsock2.h>
190189
#include <ws2tcpip.h>
191190

191+
// afunix.h uses types declared in winsock2.h, so has to be included after it.
192+
#include <afunix.h>
193+
192194
#ifndef WSA_FLAG_NO_HANDLE_INHERIT
193195
#define WSA_FLAG_NO_HANDLE_INHERIT 0x80
194196
#endif

0 commit comments

Comments
 (0)