summaryrefslogtreecommitdiff
path: root/src/netops.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2011-07-06 09:11:03 +0200
committerCarlos Martín Nieto <carlos@cmartin.tk>2011-07-06 12:48:23 +0200
commit39cdf2728052a0817c12ec4348eef2c5d0825661 (patch)
tree35cff60355ded2d4b07de8d94c6b3cba1ce1ac0a /src/netops.c
parente1bf24c86221fb412df52340ef2faa65c816c7bf (diff)
downloadlibgit2-39cdf2728052a0817c12ec4348eef2c5d0825661.tar.gz
Fix network MSYS compilation
MSYS/MinGW uses winsock but obviously doesn't set _MSC_VER. Use _WIN32 to decide whether to use winsock or BSD headers. Also remove these headers from src/transport_git.c altogether, as they are not needed. MSYS is very conservative, so we have to tell it that we don't care about versions of Windows lower than WindowsXP. We also need to tell CMake to add ws2_32 to the libraries list and we shouldn't add the -fPIC option, to MSYS because it complains that it does it anyway. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Diffstat (limited to 'src/netops.c')
-rw-r--r--src/netops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/netops.c b/src/netops.c
index 613226d46..55cb7e45e 100644
--- a/src/netops.c
+++ b/src/netops.c
@@ -23,11 +23,12 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef _MSC_VER
+#ifndef _WIN32
# include <sys/types.h>
# include <sys/socket.h>
# include <netdb.h>
#else
+# define _WIN32_WINNT 0x0501
# include <winsock2.h>
# include <Ws2tcpip.h>
# pragma comment(lib, "Ws2_32.lib")