Skip to content

Commit 1bcfa53

Browse files
authored
fix compilation problem on gcc-14.2 (#167)
1 parent 98bbeef commit 1bcfa53

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

cmake/gtest_gmock.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
include(FetchContent)
1515

16-
set(GTEST_VET 1.10.0)
16+
set(GTEST_VET 1.11.0)
1717
set(GTEST_URL https://github.com/google/googletest/archive/release-${GTEST_VET}.tar.gz)
1818

1919
FetchContent_Declare(

cmake/rapidjson.cmake

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ FetchContent_GetProperties(com_github_tencent_rapidjson)
2828
if(NOT com_github_tencent_rapidjson_POPULATED)
2929
FetchContent_Populate(com_github_tencent_rapidjson)
3030

31+
execute_process(COMMAND git apply ${TRPC_ROOT_PATH}/third_party/com_github_tencent_rapidjson/0001-remove-non-compiling-assignment-operator.patch
32+
--directory cmake_third_party/rapidjson
33+
WORKING_DIRECTORY ${TRPC_ROOT_PATH})
34+
3135
add_definitions(-DRAPIDJSON_HAS_STDSTRING)
3236
include_directories("${TRPC_ROOT_PATH}/cmake_third_party/rapidjson/include/")
3337

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 4bd1e5f857adfc3363126e2001de935183808f1a Mon Sep 17 00:00:00 2001
2+
From: zhangyi1357 <[email protected]>
3+
Date: Wed, 7 Aug 2024 14:31:29 +0800
4+
Subject: [PATCH] remove non-compiling assignment operator
5+
6+
---
7+
include/rapidjson/document.h | 2 --
8+
1 file changed, 2 deletions(-)
9+
10+
diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h
11+
index e3e20dfb..b0f1f70b 100644
12+
--- a/include/rapidjson/document.h
13+
+++ b/include/rapidjson/document.h
14+
@@ -316,8 +316,6 @@ struct GenericStringRef {
15+
16+
GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {}
17+
18+
- GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; }
19+
-
20+
//! implicit conversion to plain CharType pointer
21+
operator const Ch *() const { return s; }
22+
23+
--
24+
2.46.0
25+

trpc/config/trpc_conf_compatible.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ std::optional<T> LoadConfig(const std::string& plugin_name, const std::string& c
4141
const std::any& params = nullptr) {
4242
std::optional<T> ret;
4343
// Determine the type of support
44-
if constexpr (std::negation_v<T, Json::Value> && std::negation_v<T, YAML::Node> &&
45-
std::negation_v<T, std::map<std::string, std::string> >) {
44+
if constexpr (std::negation_v<std::is_same<T, Json::Value>> && std::negation_v<std::is_same<T, YAML::Node>> &&
45+
std::negation_v<std::is_same<T, std::map<std::string, std::string>>>) {
4646
TRPC_LOG_ERROR("Unknown type!");
4747
return ret;
4848
}

0 commit comments

Comments
 (0)