summaryrefslogtreecommitdiff
path: root/lib/compiler.h
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2024-03-20 19:20:18 +0000
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-03-22 07:21:23 +0000
commitc371aef0f92cbcce8140c140bc955de39441b427 (patch)
tree7a53c684508313e8019ea187ca10eac937f2e8d5 /lib/compiler.h
parent2cf90b1dd25b73b0f9f320e2b9304ca18de0f1a6 (diff)
grpc: fix grpc for various failures
lib: don't define a `fallthrough` in c++ to avoid conflict with protobuf c++ check: add link libs required by some versions of grpc++ or it's dependent linked libs tests: don't fail the test due to known at exit memleaks Signed-off-by: Christian Hopps <chopps@labn.net> (cherry picked from commit 043a4183c2f10e6117695dec7a0373c1b0a63808)
Diffstat (limited to 'lib/compiler.h')
-rw-r--r--lib/compiler.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/compiler.h b/lib/compiler.h
index 617b0c265b..03261052a2 100644
--- a/lib/compiler.h
+++ b/lib/compiler.h
@@ -32,7 +32,7 @@ extern "C" {
#if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 5)
# define _RET_NONNULL , returns_nonnull
#endif
-#if __has_attribute(fallthrough)
+#if __has_attribute(fallthrough) && !defined(__cplusplus)
# define fallthrough __attribute__((fallthrough));
#endif
# define _CONSTRUCTOR(x) constructor(x)
@@ -56,7 +56,7 @@ extern "C" {
#if __GNUC__ < 5
# define __has_attribute(x) 0
#endif
-#if __GNUC__ >= 7
+#if __GNUC__ >= 7 && !defined(__cplusplus)
# define fallthrough __attribute__((fallthrough));
#endif
#endif
@@ -112,7 +112,7 @@ extern "C" {
#ifndef _ALLOC_SIZE
# define _ALLOC_SIZE(x)
#endif
-#ifndef fallthrough
+#if !defined(fallthrough) && !defined(__cplusplus)
#define fallthrough
#endif
#ifndef _DEPRECATED