[libdrm patch] Fix build with -std=c11

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have a simple one-line patch that fixes the libdrm build with -std=c11.  I would appreciate if anyone with commit access could merge the attached change on my behalf.

Thanks!
Tom
From fc7a593454030df2b06e5b9dbafaa666d51a30ac Mon Sep 17 00:00:00 2001
From: Tom Anderson <thomasanderson@xxxxxxxxxxxx>
Date: Wed, 25 Jul 2018 12:06:29 -0700
Subject: [PATCH] Fix build with -std=c11

typeof() is a GNU extension that will only work when the compiler is passed
-std=gnu*.  __typeof__() works with -std=c*, however.
---
 util_math.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util_math.h b/util_math.h
index 02b15a8e..35bf4512 100644
--- a/util_math.h
+++ b/util_math.h
@@ -29,6 +29,6 @@
 #define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
 
 #define __align_mask(value, mask)  (((value) + (mask)) & ~(mask))
-#define ALIGN(value, alignment)    __align_mask(value, (typeof(value))((alignment) - 1))
+#define ALIGN(value, alignment)    __align_mask(value, (__typeof__(value))((alignment) - 1))
 
 #endif /*_UTIL_MATH_H_*/
-- 
2.18.0.233.g985f88cf7e-goog

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux