diff mbox

[1/3] drm: Make drm.h uapi header safe for C++

Message ID 1459347584-30566-1-git-send-email-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter March 30, 2016, 2:19 p.m. UTC
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 <emil.l.velikov@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 include/uapi/drm/drm.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Gabriel Laskar April 6, 2016, 3:58 p.m. UTC | #1
On Wed, 30 Mar 2016 16:19:42 +0200
Daniel Vetter <daniel.vetter@ffwll.ch> wrote:

> 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 <emil.l.velikov@gmail.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  include/uapi/drm/drm.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index a0ebfe7c9a28..d299c7749091 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -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 */ };
>  

Why not simply rename the field ?
Emil Velikov April 6, 2016, 4:35 p.m. UTC | #2
On 6 April 2016 at 16:58, Gabriel Laskar <gabriel@lse.epita.fr> wrote:
> On Wed, 30 Mar 2016 16:19:42 +0200
> Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
>> 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 <emil.l.velikov@gmail.com>
>> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>> ---
>>  include/uapi/drm/drm.h | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
>> index a0ebfe7c9a28..d299c7749091 100644
>> --- a/include/uapi/drm/drm.h
>> +++ b/include/uapi/drm/drm.h
>> @@ -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 */ };
>>
>
> Why not simply rename the field ?
>
It will break existing users. Some of which haven't been
updated/maintained in a long while.

-Emil
diff mbox

Patch

diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index a0ebfe7c9a28..d299c7749091 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -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 */
 };