Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150359048
D50157.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D50157.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/stddef.h b/sys/compat/linuxkpi/common/include/linux/stddef.h
--- a/sys/compat/linuxkpi/common/include/linux/stddef.h
+++ b/sys/compat/linuxkpi/common/include/linux/stddef.h
@@ -5,11 +5,27 @@
#include <sys/stddef.h>
-#define struct_group(NAME, ...) \
+/*
+ * FreeBSD has multiple (vendor) drivers containing copies of this
+ * and including LinuxKPI headers. Put the #defines behind guards.
+ */
+
+#ifndef __struct_group
+#define __struct_group(_tag, _name, _attrs, _members...) \
union { \
- struct { __VA_ARGS__ }; \
- struct { __VA_ARGS__ } NAME; \
- }
+ struct { _members } _attrs; \
+ struct _tag { _members } _attrs _name; \
+ } _attrs
+#endif
-#endif /* _LINUXKPI_LINUX_STDDEF_H_ */
+#ifndef struct_group
+#define struct_group(_name, _members...) \
+ __struct_group(/* no tag */, _name, /* no attrs */, _members)
+#endif
+#ifndef struct_group_tagged
+#define struct_group_tagged(_tag, _name, _members...) \
+ __struct_group(_tag, _name, /* no attrs */, _members)
+#endif
+
+#endif /* _LINUXKPI_LINUX_STDDEF_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 1, 12:48 PM (2 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30677915
Default Alt Text
D50157.diff (1 KB)
Attached To
Mode
D50157: LinuxKPI: add struct_group_tagged()
Attached
Detach File
Event Timeline
Log In to Comment