diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h index 93291a174da..e5d45590aec 100644 --- a/include/grpc/support/port_platform.h +++ b/include/grpc/support/port_platform.h @@ -46,10 +46,11 @@ #define NOMINMAX #endif /* NOMINMAX */ -#if defined(_WIN32_WINNT) -#if _WIN32_WINNT < 0x0600 -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0600 +#ifndef _WIN32_WINNT +#error "Please compile grpc with _WIN32_WINNT of at least 0x600 (aka Windows Vista)" +#else /* !defined(_WIN32_WINNT) */ +#if (_WIN32_WINNT < 0x0600) +#error "Please compile grpc with _WIN32_WINNT of at least 0x600 (aka Windows Vista)" #endif /* _WIN32_WINNT < 0x0600 */ #endif /* defined(_WIN32_WINNT) */ diff --git a/templates/vsprojects/global.props.template b/templates/vsprojects/global.props.template index 0fc86c45463..5b8d1e1182a 100644 --- a/templates/vsprojects/global.props.template +++ b/templates/vsprojects/global.props.template @@ -10,7 +10,7 @@ $(SolutionDir)\..;$(SolutionDir)\..\include;$(SolutionDir)\..\third_party\protobuf\src;${';'.join('$(SolutionDir)\\packages\\%s.%s\\build\\native\\include' % (p.name, p.version) for p in vspackages)};%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions) + _WIN32_WINNT=0x600;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions) EnableAllWarnings diff --git a/vsprojects/global.props b/vsprojects/global.props index 3ee06ac849f..8786497ef33 100644 --- a/vsprojects/global.props +++ b/vsprojects/global.props @@ -8,7 +8,7 @@ $(SolutionDir)\..;$(SolutionDir)\..\include;$(SolutionDir)\..\third_party\protobuf\src;$(SolutionDir)\packages\grpc.dependencies.zlib.1.2.8.9\build\native\include;$(SolutionDir)\packages\grpc.dependencies.openssl.1.0.2.3\build\native\include;$(SolutionDir)\packages\gflags.2.1.2.1\build\native\include;$(SolutionDir)\packages\gtest.1.7.0.1\build\native\include;%(AdditionalIncludeDirectories) - _SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions) + _WIN32_WINNT=0x600;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions) EnableAllWarnings