summaryrefslogtreecommitdiff
path: root/tools/include
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2025-01-10 07:24:17 +0300
committerDave Airlie <airlied@redhat.com>2025-01-10 07:24:17 +0300
commitf6001870edeabf0f7bc0460303d0cdbb9f0b3bc4 (patch)
treeacda60340b486b9893d96b864617f66286a4c3c6 /tools/include
parent6ec692d6a5f3ab916133e2c25fa9925862210de0 (diff)
parent9d89551994a430b50c4fffcb1e617a057fa76e20 (diff)
downloadlinux-f6001870edeabf0f7bc0460303d0cdbb9f0b3bc4.tar.xz
Merge tag 'v6.13-rc6' into drm-next
This backmerges Linux 6.13-rc6 this is need for the newer pulls. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/uapi/linux/stddef.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/include/uapi/linux/stddef.h b/tools/include/uapi/linux/stddef.h
index bb6ea517efb5..c53cde425406 100644
--- a/tools/include/uapi/linux/stddef.h
+++ b/tools/include/uapi/linux/stddef.h
@@ -8,6 +8,13 @@
#define __always_inline __inline__
#endif
+/* Not all C++ standards support type declarations inside an anonymous union */
+#ifndef __cplusplus
+#define __struct_group_tag(TAG) TAG
+#else
+#define __struct_group_tag(TAG)
+#endif
+
/**
* __struct_group() - Create a mirrored named and anonyomous struct
*
@@ -20,14 +27,14 @@
* and size: one anonymous and one named. The former's members can be used
* normally without sub-struct naming, and the latter can be used to
* reason about the start, end, and size of the group of struct members.
- * The named struct can also be explicitly tagged for layer reuse, as well
- * as both having struct attributes appended.
+ * The named struct can also be explicitly tagged for layer reuse (C only),
+ * as well as both having struct attributes appended.
*/
#define __struct_group(TAG, NAME, ATTRS, MEMBERS...) \
union { \
struct { MEMBERS } ATTRS; \
- struct TAG { MEMBERS } ATTRS NAME; \
- }
+ struct __struct_group_tag(TAG) { MEMBERS } ATTRS NAME; \
+ } ATTRS
/**
* __DECLARE_FLEX_ARRAY() - Declare a flexible array usable in a union