diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-03-22 09:20:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-22 09:20:20 +0200 |
| commit | 7ad84a469844f02340f632472bd5346f88f82b0e (patch) | |
| tree | b22053d1af44b3d40380def5cc92c4b788e3b44d /lib/compiler.h | |
| parent | 08c56b40b606b33cf5854a1b1b086d9f48e5e582 (diff) | |
| parent | 043a4183c2f10e6117695dec7a0373c1b0a63808 (diff) | |
Merge pull request #15587 from LabNConsulting/chopps/fix-grpc-protobuf
grpc: fix grpc for various failures
Diffstat (limited to 'lib/compiler.h')
| -rw-r--r-- | lib/compiler.h | 6 |
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 |
