drm: Make drm.h uapi header safe for C++
Subsystems (2)
PATCH 1/1 drm: Make drm.h uapi header safe for C++
virtual is a protected keyword in C++ and can't be used at all. Ugh.
This aligns the kernel versions of the drm headers with the ones in libdrm.
--- include/uapi/drm/drm.h | 4 ++++ 1 file changed, 4 insertions(+)
include/uapi/drm/drm.h +4 -0
@@ -373,7 +373,11 @@ struct drm_buf_pub {*/ struct drm_buf_map {int count;/**< Length of the buffer list */ +#ifdef __cplusplus +void *virt; +#else void __user *virtual;/**< Mmap'd area in user-virtual */ +#endif struct drm_buf_pub __user *list;/**< Buffer information */ };
Signature · 6 lines
2.8.0.rc3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 16 lines · Daniel Vetter
virtual is a protected keyword in C++ and can't be used at all. Ugh.
This aligns the kernel versions of the drm headers with the ones in libdrm.
Cc Emil Velikov <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- include/uapi/drm/drm.h | 4 ++++ 1 file changed, 4 insertions(+)include/uapi/drm/drm.h +0
-0
include/uapi/drm/drm.h struct drm_buf_pub { · line 377
Quoted 5 lines
include/uapi/drm/drm.h +2
-0@@ -373,7 +373,11 @@ struct drm_buf_pub {*/ struct drm_buf_map {int count;/**< Length of the buffer list */ +#ifdef __cplusplus +void *virt;
Shouldn't this also be __user for consistency? (I realize it'll never play since the kernel doesn't get built with C++...)
Quoted 9 lines
include/uapi/drm/drm.h +2
-1+#else void __user *virtual;/**< Mmap'd area in user-virtual */ +#endif struct drm_buf_pub __user *list;/**< Buffer information */ }; --2.8.0.rc3
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 12 lines · Ilia Mirkin
Quoted 11 lines · Daniel Vetter
virtual is a protected keyword in C++ and can't be used at all. Ugh.
This aligns the kernel versions of the drm headers with the ones in libdrm.
Cc Emil Velikov <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- include/uapi/drm/drm.h | 4 ++++ 1 file changed, 4 insertions(+)
Quoted 14 lines
include/uapi/drm/drm.h struct drm_buf_pub { · line 377
Quoted 10 lines
include/uapi/drm/drm.h +2
-0@@ -373,7 +373,11 @@ struct drm_buf_pub {*/ struct drm_buf_map {int count;/**< Length of the buffer list */ +#ifdef __cplusplus +void *virt;Shouldn't this also be
__userfor consistency? (I realize it'll never play since the kernel doesn't get built with C++...)
Yes please. There is also a bunch of extern C guards that could be nice, but that's a whole another thing.
-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel