From a1f58d35be58a5bc61cbc297c8deef08b7504d00 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Fri, 12 Sep 2014 20:07:05 -0400 Subject: [PATCH] [runtime] Fix the windows build. Define _WINSOCKAPI_ to fix the compilation problems when windows.h is included before winsock2.h: http://stackoverflow.com/questions/1372480/c-redefinition-header-files. --- mono/utils/mono-compiler.h | 4 +++- mono/utils/mono-poll.c | 5 +++++ msvc/mono.def | 1 - msvc/mono.props | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) mode change 100644 => 100755 mono/utils/mono-poll.c diff --git a/mono/utils/mono-compiler.h b/mono/utils/mono-compiler.h index c1d0e27a49c..2b330b9bb9d 100644 --- a/mono/utils/mono-compiler.h +++ b/mono/utils/mono-compiler.h @@ -198,10 +198,12 @@ #endif #include -#define isnan(x) _isnan(x) #define trunc(x) (((x) < 0) ? ceil((x)) : floor((x))) +#if _MSC_VER < 1800 /* VS 2013 */ +#define isnan(x) _isnan(x) #define isinf(x) (_isnan(x) ? 0 : (_fpclass(x) == _FPCLASS_NINF) ? -1 : (_fpclass(x) == _FPCLASS_PINF) ? 1 : 0) #define isnormal(x) _finite(x) +#endif #define popen _popen #define pclose _pclose diff --git a/mono/utils/mono-poll.c b/mono/utils/mono-poll.c old mode 100644 new mode 100755 index 7326254c35b..5e5adfe2f00 --- a/mono/utils/mono-poll.c +++ b/mono/utils/mono-poll.c @@ -20,6 +20,11 @@ mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout) } #else +#ifdef HOST_WIN32 +/* For select */ +#include +#endif + int mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout) { diff --git a/msvc/mono.def b/msvc/mono.def index 61d1779c336..72c3c4c0d7e 100644 --- a/msvc/mono.def +++ b/msvc/mono.def @@ -537,7 +537,6 @@ mono_metadata_guid_heap mono_metadata_implmap_from_method mono_metadata_init mono_metadata_interfaces_from_typedef -mono_metadata_load_generic_param_constraints mono_metadata_load_generic_params mono_metadata_locate mono_metadata_locate_token diff --git a/msvc/mono.props b/msvc/mono.props index 7fe3206e248..ef26f9180d7 100644 --- a/msvc/mono.props +++ b/msvc/mono.props @@ -1,4 +1,4 @@ - + $(MSBuildProjectDirectory)\.. @@ -9,7 +9,7 @@ - __default_codegen__;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;GC_NOT_DLL;WIN32_THREADS;WINVER=0x0500;_WIN32_WINNT=0x0500;_WIN32_IE=0x0501;_UNICODE;UNICODE;WIN32_THREADS;FD_SETSIZE=1024;$(PreprocessorDefinitions) + __default_codegen__;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;GC_NOT_DLL;WIN32_THREADS;WINVER=0x0500;_WIN32_WINNT=0x0500;_WIN32_IE=0x0501;_UNICODE;UNICODE;WIN32_THREADS;FD_SETSIZE=1024;$(PreprocessorDefinitions);_WINSOCKAPI_ Mswsock.lib;ws2_32.lib;ole32.lib;oleaut32.lib;psapi.lib;version.lib;advapi32.lib;winmm.lib;kernel32.lib;$(AdditionalDependencies) -- 2.25.1