etcd-cpp-apiv3: Fix build with gprc 2.66+

GPR_ASSERT is removed from latest gprc

Fixes
   | /home/pokybuild/yocto-worker/meta-oe/build/build/tmp-glibc/work/core2-64-poky-linux/etcd-cpp-apiv3/0.15.4/git/src/v3/Action.cpp: In member function 'void etcdv3::Action::waitForResponse()':
   | /home/pokybuild/yocto-worker/meta-oe/build/build/tmp-glibc/work/core2-64-poky-linux/etcd-cpp-apiv3/0.15.4/git/src/v3/Action.cpp:101:5: error: 'GPR_ASSERT' was not declared in this scope
   |   101 |     GPR_ASSERT(got_tag == (void*) this);
   |       |     ^~~~~~~~~~

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj
2024-09-04 15:06:38 -07:00
parent 68f542b606
commit 394f3537c5
2 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
From aeb34f58782fb6d06aea4f5cbeccb23a0224466e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 4 Sep 2024 14:54:42 -0700
Subject: [PATCH] Replacing GPR_ASSERT with c assert
Latest GRPC >= 2.66 has dropped GRPC_ASSERT macro [1]
[1] https://github.com/grpc/grpc/commit/0e23c2259da967a037e839e80cafd62bc6f9f68e
Upstream-Status: Submitted [https://github.com/etcd-cpp-apiv3/etcd-cpp-apiv3/pull/281]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/v3/Action.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/src/v3/Action.cpp
+++ b/src/v3/Action.cpp
@@ -2,6 +2,15 @@
#include <grpc/support/log.h>
#include <grpcpp/support/status.h>
#include "etcd/v3/action_constants.hpp"
+#include <cstdlib>
+
+#ifndef GPR_ASSERT
+#define GPR_ASSERT(x) \
+ if (!(x)) { \
+ fprintf(stderr, "%s:%d assert failed\n", __FILE__, __LINE__); \
+ abort(); \
+}
+#endif
etcdv3::Action::Action(etcdv3::ActionParameters const& params) {
parameters = params;

View File

@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=eae7da6a2cd1788a5cf8a9f838cf6450"
SRC_URI = " \
git://github.com/etcd-cpp-apiv3/etcd-cpp-apiv3.git;branch=master;protocol=https \
file://0001-include-stdint.h-for-int64_t-types.patch \
file://0001-Replacing-GPR_ASSERT-with-c-assert.patch \
"
SRCREV = "ba6216385fc332b23d95683966824c2b86c2474e"