summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorq662023-12-15 22:42:34 +0100
committerJulien Voisin2023-12-15 22:50:23 +0100
commitc607773a80e6685ab4c922245c33cf2ea5dcfb72 (patch)
tree8e351916f210eea91fbef2b40d9df34703949e24
parent3e00ac383b23479e0df24c531e3128d7076c4755 (diff)
Do not use static inline for C++ to avoid ODR violations
Fixes https://github.com/jvoisin/fortify-headers/issues/31
-rw-r--r--include/fortify-headers.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/fortify-headers.h b/include/fortify-headers.h
index bd53954..70b7952 100644
--- a/include/fortify-headers.h
+++ b/include/fortify-headers.h
@@ -39,8 +39,13 @@
39 39
40/* clang uses overloads; see https://github.com/llvm/llvm-project/issues/53516 */ 40/* clang uses overloads; see https://github.com/llvm/llvm-project/issues/53516 */
41/* we can't use extern inline with overloads without making them external */ 41/* we can't use extern inline with overloads without making them external */
42#ifdef __cplusplus
43#define _FORTIFY_INLINE __inline__ \
44 __attribute__((__always_inline__,__artificial__,__overloadable__))
45#else
42#define _FORTIFY_INLINE static __inline__ \ 46#define _FORTIFY_INLINE static __inline__ \
43 __attribute__((__always_inline__,__artificial__,__overloadable__)) 47 __attribute__((__always_inline__,__artificial__,__overloadable__))
48#endif
44 49
45#else /* !__clang__ */ 50#else /* !__clang__ */
46 51