diff options
| author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2026-04-14 15:06:56 +0000 |
|---|---|---|
| committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2026-04-18 01:12:12 +0000 |
| commit | 524df650a92f648e19ba27d6727bdc79c8efdbbb (patch) | |
| tree | 197639356c810088a27d1ded0cbb8e5abb9f12f1 /sys/compat/linuxkpi/common/include/linux | |
| parent | 35b90c21f48056e85b70dbbe2209b6c3a4927315 (diff) | |
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux')
| -rw-r--r-- | sys/compat/linuxkpi/common/include/linux/compiler_types.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/compiler_types.h b/sys/compat/linuxkpi/common/include/linux/compiler_types.h index 7151c03de690..25e69f5afd8e 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler_types.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler_types.h @@ -42,4 +42,17 @@ #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) +/* + * __builtin_counted_by_ref was introduced to + * - gcc in e7380688fa59 with a first release tag of gcc-15.1.0, + * - llvm in 7475156d49406 with a first release tag of llvmorg-20.1.0-rc1 + * but cannot be used before 23 (22.x.y possibly) (see 09a3d830a888). + */ +#if (__has_builtin(__builtin_counted_by_ref)) && \ + (!defined(__clang__) || (__clang_major__ >= 23)) +#define __flex_counter(_field) __builtin_counted_by_ref(_field) +#else +#define __flex_counter(_field) ((void *)NULL) +#endif + #endif |
