mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 17:49:00 +08:00
ebe505081b
* WIP - Upgrade gRPC to 1.26.0
* Updated patch 00001
* Update 00002 patch.
* Update 00003
* Update 00005
* Remove 00007 patch.
* Really fix patch 00005
* Use CRLF for patches as before 🤷
87 lines
3.2 KiB
Diff
87 lines
3.2 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 3d4418a..a2f23d5 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -104,6 +104,9 @@ if(UNIX)
|
|
endif()
|
|
if(WIN32)
|
|
set(_gRPC_PLATFORM_WINDOWS ON)
|
|
+ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
+ set(_gRPC_PLATFORM_UWP ON)
|
|
+ endif()
|
|
endif()
|
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
|
|
@@ -119,6 +122,9 @@ if(MSVC)
|
|
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4267")
|
|
# TODO(jtattermusch): needed to build boringssl with VS2017, revisit later
|
|
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4987 /wd4774 /wd4819 /wd4996 /wd4619")
|
|
+ if(_gRPC_PLATFORM_UWP)
|
|
+ add_definitions(-DGRPC_ARES=0)
|
|
+ endif()
|
|
endif()
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_gRPC_C_CXX_FLAGS}")
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_gRPC_C_CXX_FLAGS}")
|
|
@@ -186,6 +192,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR})
|
|
# ``.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()
|
|
@@ -258,6 +268,7 @@ if (gRPC_BUILD_GRPC_RUBY_PLUGIN)
|
|
list(APPEND _gRPC_PLUGIN_LIST grpc_ruby_plugin)
|
|
endif ()
|
|
|
|
+if(NOT _gRPC_PLATFORM_UWP)
|
|
add_custom_target(plugins
|
|
DEPENDS ${_gRPC_PLUGIN_LIST}
|
|
)
|
|
@@ -279,6 +290,7 @@ add_custom_target(tools_cxx
|
|
|
|
add_custom_target(tools
|
|
DEPENDS tools_c tools_cxx)
|
|
+endif()
|
|
|
|
protobuf_generate_grpc_cpp(
|
|
src/proto/grpc/channelz/channelz.proto
|
|
diff --git a/src/core/lib/iomgr/resource_quota.cc b/src/core/lib/iomgr/resource_quota.cc
|
|
index 0fc0279..aaf2b09 100644
|
|
--- a/src/core/lib/iomgr/resource_quota.cc
|
|
+++ b/src/core/lib/iomgr/resource_quota.cc
|
|
@@ -945,7 +945,7 @@ bool grpc_resource_user_alloc(grpc_resource_user* resource_user, size_t size,
|
|
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
|
|
index 59432cf..fed574d 100644
|
|
--- a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
|
|
+++ b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
|
|
@@ -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) {
|
|
+#if !defined(WINAPI_FAMILY) || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
|
|
const size_t kProductNameBufferSize = 256;
|
|
char const expected_substr[] = "Google";
|
|
|
|
@@ -71,6 +72,9 @@ bool check_windows_registry_product_name(HKEY root_key,
|
|
}
|
|
|
|
return strstr(buffer, expected_substr) != nullptr;
|
|
+#else
|
|
+ return false;
|
|
+#endif
|
|
}
|
|
|
|
} // namespace internal
|