[Mesa-dev] [PATCH 08/18] swr: [rasterizer common] gcc/clang cleanup

Tim Rowley timothy.o.rowley at intel.com
Tue May 17 01:10:47 UTC 2016


---
 src/gallium/drivers/swr/rasterizer/common/os.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/gallium/drivers/swr/rasterizer/common/os.h b/src/gallium/drivers/swr/rasterizer/common/os.h
index 7bfc66f..675fe42 100644
--- a/src/gallium/drivers/swr/rasterizer/common/os.h
+++ b/src/gallium/drivers/swr/rasterizer/common/os.h
@@ -97,6 +97,14 @@ typedef unsigned int    DWORD;
 #define __declspec(X)
 #endif
 
+#if !defined(offsetof)
+    #ifdef __cplusplus
+        #define offsetof(s,m) ((size_t)&reinterpret_cast<char const volatile&>((((s*)0)->m)))
+    #else
+        #define offsetof(s,m) ((size_t)&(((s*)0)->m))
+    #endif
+#endif // offsetof
+
 #define GCC_VERSION (__GNUC__ * 10000 \
                      + __GNUC_MINOR__ * 100 \
                      + __GNUC_PATCHLEVEL__)
-- 
1.9.1



More information about the mesa-dev mailing list