diff options
| author | q66 | 2023-12-15 22:42:34 +0100 |
|---|---|---|
| committer | jvoisin | 2025-11-10 23:55:25 +0100 |
| commit | a89ddb4cf1ce1694b74feb98d62d5600e02904af (patch) | |
| tree | c823a9ec270c9c8b9bfe997b3f55de41ef4b495f /include | |
| parent | bc2641769ec3019ab7d794b032a6e36030581c76 (diff) | |
Do not use static inline for C++ to avoid ODR violations
Fixes https://github.com/jvoisin/fortify-headers/issues/31
Diffstat (limited to 'include')
| -rw-r--r-- | include/fortify-headers.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/fortify-headers.h b/include/fortify-headers.h index b116290..e406dce 100644 --- a/include/fortify-headers.h +++ b/include/fortify-headers.h | |||
| @@ -27,8 +27,13 @@ | |||
| 27 | #endif | 27 | #endif |
| 28 | 28 | ||
| 29 | /* we can't use extern inline with overloads without making them external */ | 29 | /* we can't use extern inline with overloads without making them external */ |
| 30 | #ifdef __cplusplus | ||
| 31 | #define _FORTIFY_INLINE __inline__ \ | ||
| 32 | __attribute__((__always_inline__,__artificial__,__overloadable__)) | ||
| 33 | #else | ||
| 30 | #define _FORTIFY_INLINE static __inline__ \ | 34 | #define _FORTIFY_INLINE static __inline__ \ |
| 31 | __attribute__((__always_inline__,__artificial__,__overloadable__)) | 35 | __attribute__((__always_inline__,__artificial__,__overloadable__)) |
| 36 | #endif | ||
| 32 | 37 | ||
| 33 | #else /* !__clang__ */ | 38 | #else /* !__clang__ */ |
| 34 | 39 | ||
