2019-05-17 11:18:26 -07:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2020-10-28 04:33:33 +01:00
|
|
|
index 1911144984..8f78306f77 100644
|
2019-05-17 11:18:26 -07:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2020-10-23 07:46:48 +02:00
|
|
|
@@ -181,6 +181,9 @@ if(UNIX)
|
2019-05-17 11:18:26 -07:00
|
|
|
endif()
|
|
|
|
if(WIN32)
|
|
|
|
set(_gRPC_PLATFORM_WINDOWS ON)
|
|
|
|
+ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
|
|
+ set(_gRPC_PLATFORM_UWP ON)
|
|
|
|
+ endif()
|
|
|
|
endif()
|
|
|
|
|
2020-06-24 05:36:26 +08:00
|
|
|
# Use C99 standard
|
2020-10-23 07:46:48 +02:00
|
|
|
@@ -219,6 +222,9 @@ if(MSVC)
|
2020-01-06 15:24:51 -05:00
|
|
|
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4267")
|
2019-05-17 11:18:26 -07:00
|
|
|
# TODO(jtattermusch): needed to build boringssl with VS2017, revisit later
|
2020-01-06 15:24:51 -05:00
|
|
|
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4987 /wd4774 /wd4819 /wd4996 /wd4619")
|
2019-05-17 11:18:26 -07:00
|
|
|
+ if(_gRPC_PLATFORM_UWP)
|
|
|
|
+ add_definitions(-DGRPC_ARES=0)
|
|
|
|
+ endif()
|
|
|
|
endif()
|
2020-08-22 10:16:03 +02:00
|
|
|
if (MINGW)
|
|
|
|
add_definitions(-D_WIN32_WINNT=0x600)
|
2020-10-23 07:46:48 +02:00
|
|
|
@@ -286,6 +292,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR})
|
2019-05-17 11:18:26 -07:00
|
|
|
# ``.proto`` files
|
|
|
|
#
|
|
|
|
function(protobuf_generate_grpc_cpp)
|
|
|
|
+ if(_gRPC_PLATFORM_UWP)
|
|
|
|
+ return()
|
|
|
|
+ endif()
|
|
|
|
+
|
|
|
|
if(NOT ARGN)
|
|
|
|
message(SEND_ERROR "Error: PROTOBUF_GENERATE_GRPC_CPP() called without any proto files")
|
|
|
|
return()
|
2020-10-23 07:46:48 +02:00
|
|
|
@@ -358,6 +368,7 @@ if (gRPC_BUILD_GRPC_RUBY_PLUGIN)
|
2020-01-06 15:24:51 -05:00
|
|
|
list(APPEND _gRPC_PLUGIN_LIST grpc_ruby_plugin)
|
|
|
|
endif ()
|
2019-05-17 11:18:26 -07:00
|
|
|
|
|
|
|
+if(NOT _gRPC_PLATFORM_UWP)
|
|
|
|
add_custom_target(plugins
|
2020-01-06 15:24:51 -05:00
|
|
|
DEPENDS ${_gRPC_PLUGIN_LIST}
|
|
|
|
)
|
2020-10-23 07:46:48 +02:00
|
|
|
@@ -376,6 +387,7 @@ add_custom_target(tools_cxx
|
2020-01-06 15:24:51 -05:00
|
|
|
|
2019-05-17 11:18:26 -07:00
|
|
|
add_custom_target(tools
|
|
|
|
DEPENDS tools_c tools_cxx)
|
|
|
|
+endif()
|
|
|
|
|
2020-01-06 15:24:51 -05:00
|
|
|
protobuf_generate_grpc_cpp(
|
|
|
|
src/proto/grpc/channelz/channelz.proto
|
2019-05-17 11:18:26 -07:00
|
|
|
diff --git a/src/core/lib/iomgr/resource_quota.cc b/src/core/lib/iomgr/resource_quota.cc
|
2020-08-23 07:25:20 +02:00
|
|
|
index dbe84e3466..cda40b6435 100644
|
2019-05-17 11:18:26 -07:00
|
|
|
--- a/src/core/lib/iomgr/resource_quota.cc
|
|
|
|
+++ b/src/core/lib/iomgr/resource_quota.cc
|
2020-08-23 07:25:20 +02:00
|
|
|
@@ -945,7 +945,7 @@ bool grpc_resource_user_alloc(grpc_resource_user* resource_user, size_t size,
|
2019-05-17 11:18:26 -07:00
|
|
|
void grpc_resource_user_free(grpc_resource_user* resource_user, size_t size) {
|
|
|
|
gpr_mu_lock(&resource_user->mu);
|
|
|
|
grpc_resource_quota* resource_quota = resource_user->resource_quota;
|
|
|
|
- gpr_atm prior = gpr_atm_no_barrier_fetch_add(&resource_quota->used, -size);
|
|
|
|
+ gpr_atm prior = gpr_atm_no_barrier_fetch_add(&resource_quota->used, -static_cast<gpr_atm>(size));
|
|
|
|
GPR_ASSERT(prior >= static_cast<long>(size));
|
|
|
|
bool was_zero_or_negative = resource_user->free_pool <= 0;
|
|
|
|
resource_user->free_pool += static_cast<int64_t>(size);
|
|
|
|
diff --git a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
|
2020-08-22 10:16:03 +02:00
|
|
|
index 59432cff36..fed574d5bc 100644
|
2019-05-17 11:18:26 -07:00
|
|
|
--- a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
|
|
|
|
+++ b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
|
2020-01-06 15:24:51 -05:00
|
|
|
@@ -39,6 +39,7 @@ bool check_bios_data(const char*) { return false; }
|
|
|
|
bool check_windows_registry_product_name(HKEY root_key,
|
|
|
|
const char* reg_key_path,
|
|
|
|
const char* reg_key_name) {
|
2019-05-17 11:18:26 -07:00
|
|
|
+#if !defined(WINAPI_FAMILY) || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
|
2020-01-06 15:24:51 -05:00
|
|
|
const size_t kProductNameBufferSize = 256;
|
|
|
|
char const expected_substr[] = "Google";
|
2019-05-17 11:18:26 -07:00
|
|
|
|
2020-01-06 15:24:51 -05:00
|
|
|
@@ -71,6 +72,9 @@ bool check_windows_registry_product_name(HKEY root_key,
|
2019-05-17 11:18:26 -07:00
|
|
|
}
|
2020-01-06 15:24:51 -05:00
|
|
|
|
|
|
|
return strstr(buffer, expected_substr) != nullptr;
|
|
|
|
+#else
|
|
|
|
+ return false;
|
2019-05-17 11:18:26 -07:00
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:24:51 -05:00
|
|
|
} // namespace internal
|