Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157871788
D56393.id175806.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
876 B
Referenced Files
None
Subscribers
None
D56393.id175806.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/compiler_types.h b/sys/compat/linuxkpi/common/include/linux/compiler_types.h
--- 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
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, May 27, 1:01 AM (7 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31545227
Default Alt Text
D56393.id175806.diff (876 B)
Attached To
Mode
D56393: LinuxKPI: conditionally add __flex_counter()
Attached
Detach File
Event Timeline
Log In to Comment