Skip to content

Commit 0dc045a

Browse files
committed
conn: Fix cross compilation with mingw
Mingw doesn't find netinet/in.h which is not supposed to be used for a windows build. This header is conditionally compiled when _MSC_VER is not defined, however, mingw defines only _WIN32 and not the _MSC_VER. Add also _WIN32 to the condition, so mingw ignores the header and relies on winsock2.h from common.h->sock.h. Fixes #265.
1 parent b9eead3 commit 0dc045a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/conn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222

2323
#include <errno.h>
24-
#ifndef _MSC_VER
24+
#if !defined(_MSC_VER) && !defined(_WIN32)
2525
#include <netinet/in.h>
2626
#endif
2727
#include <stdarg.h>

0 commit comments

Comments
 (0)