From 648e9281824ddc943c3ea6b34d6d6c154717a0a3 Mon Sep 17 00:00:00 2001 From: James Park Date: Tue, 1 Dec 2020 00:58:38 -0800 Subject: [PATCH] drm: Fix drm.h uapi header for Windows This will allow Mesa to port code to Windows more easily. Hide BSD header and drm_handle_t behind _WIN32 check. Change __volatile__ to volatile, which is standard. Signed-off-by: James Park --- include/uapi/drm/drm.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h index 808b48a93330ba..53dc3c9eccbdda 100644 --- a/include/uapi/drm/drm.h +++ b/include/uapi/drm/drm.h @@ -48,10 +48,9 @@ typedef unsigned int drm_handle_t; #include typedef unsigned int drm_handle_t; -#else /* One of the BSDs */ +#else #include -#include #include typedef int8_t __s8; typedef uint8_t __u8; @@ -62,10 +61,16 @@ typedef uint32_t __u32; typedef int64_t __s64; typedef uint64_t __u64; typedef size_t __kernel_size_t; + +#ifndef _WIN32 /* One of the BSDs */ + +#include typedef unsigned long drm_handle_t; #endif +#endif + #if defined(__cplusplus) extern "C" { #endif @@ -128,7 +133,7 @@ struct drm_tex_region { * other data stored in the same cache line. */ struct drm_hw_lock { - __volatile__ unsigned int lock; /**< lock variable */ + volatile unsigned int lock; /**< lock variable */ char padding[60]; /**< Pad to cache line */ };