swr: [rasterizer common] os.h portability header changes
authorTim Rowley <timothy.o.rowley@intel.com>
Wed, 21 Sep 2016 04:55:24 +0000 (23:55 -0500)
committerTim Rowley <timothy.o.rowley@intel.com>
Mon, 3 Oct 2016 14:56:47 +0000 (09:56 -0500)
- Fix conflict between windows MemoryFence and llvm::sys::MemoryFence
- Declare gettid()

Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
src/gallium/drivers/swr/rasterizer/common/os.h

index 43d55134222e046d85cfb25cd8d61677bfc338e1..f175a8a19e515764329b33cccdd8aac04d622d8b 100644 (file)
 #include <intrin.h>
 #include <cstdint>
 
+#if defined(MemoryFence)
+// Windows.h defines MemoryFence as _mm_mfence, but this conflicts with llvm::sys::MemoryFence
+#undef MemoryFence
+#endif
+
 #define OSALIGN(RWORD, WIDTH) __declspec(align(WIDTH)) RWORD
 #define THREAD __declspec(thread)
 #define INLINE __forceinline
@@ -211,6 +216,7 @@ void AlignedFree(void* p)
 #define sprintf_s sprintf
 #define strcpy_s(dst,size,src) strncpy(dst,src,size)
 #define GetCurrentProcessId getpid
+pid_t gettid(void);
 #define GetCurrentThreadId gettid
 
 #define CreateDirectory(name, pSecurity) mkdir(name, 0777)