From e50fa1e50ee83348e5454868fd5f9dbd31f68157 Mon Sep 17 00:00:00 2001 From: "KJK::Hyperion" Date: Sat, 8 Aug 2009 17:18:34 +0000 Subject: [PATCH] modified dll/3rdparty/mesa32/src/main/imports.c We don't have _aligned_malloc in our CRT, whatever compiler we use modified dll/3rdparty/mesa32/src/main/imports.h The mysterious MESA compilation bug has been found: seems the Visual C++ preprocessor doesn't know about the "F" number suffix modified dll/3rdparty/mesa32/reactos.diff Updated the diff svn path=/trunk/; revision=42529 --- reactos/dll/3rdparty/mesa32/reactos.diff | 52 +++++++++++++++++++ .../dll/3rdparty/mesa32/src/main/imports.c | 4 +- .../dll/3rdparty/mesa32/src/main/imports.h | 8 +-- 3 files changed, 58 insertions(+), 6 deletions(-) diff --git a/reactos/dll/3rdparty/mesa32/reactos.diff b/reactos/dll/3rdparty/mesa32/reactos.diff index 87d3d6b7348..f864c7420cb 100644 --- a/reactos/dll/3rdparty/mesa32/reactos.diff +++ b/reactos/dll/3rdparty/mesa32/reactos.diff @@ -3995,3 +3995,55 @@ Index: x86/common_x86.c if ( cpu_has_xmm ) { _mesa_debug(NULL, "Yes.\n"); +Index: main/imports.c +=================================================================== +--- main/imports.c (revision 42472) ++++ main/imports.c (working copy) +@@ -104,7 +104,7 @@ + + (void) posix_memalign(& mem, alignment, bytes); + return mem; +-#elif defined(_WIN32) && defined(_MSC_VER) ++#elif 0/*defined(_WIN32) && defined(_MSC_VER)*/ + return _aligned_malloc(bytes, alignment); + #else + uintptr_t ptr, buf; +@@ -146,7 +146,7 @@ + } + + return mem; +-#elif defined(_WIN32) && defined(_MSC_VER) ++#elif 0/*defined(_WIN32) && defined(_MSC_VER)*/ + void *mem; + + mem = _aligned_malloc(bytes, alignment); +Index: main/imports.h +=================================================================== +--- main/imports.h (revision 42472) ++++ main/imports.h (working copy) +@@ -482,10 +482,10 @@ + /* This function/macro is sensitive to precision. Test very carefully + * if you change it! + */ +-#define UNCLAMPED_FLOAT_TO_UBYTE(UB, F) \ ++#define UNCLAMPED_FLOAT_TO_UBYTE(UB, F_) \ + do { \ + fi_type __tmp; \ +- __tmp.f = (F); \ ++ __tmp.f = (F_); \ + if (__tmp.i < 0) \ + UB = (GLubyte) 0; \ + else if (__tmp.i >= IEEE_0996) \ +@@ -495,10 +495,10 @@ + UB = (GLubyte) __tmp.i; \ + } \ + } while (0) +-#define CLAMPED_FLOAT_TO_UBYTE(UB, F) \ ++#define CLAMPED_FLOAT_TO_UBYTE(UB, F_) \ + do { \ + fi_type __tmp; \ +- __tmp.f = (F) * (255.0F/256.0F) + 32768.0F; \ ++ __tmp.f = (F_) * (255.0F/256.0F) + 32768.0F; \ + UB = (GLubyte) __tmp.i; \ + } while (0) + #else diff --git a/reactos/dll/3rdparty/mesa32/src/main/imports.c b/reactos/dll/3rdparty/mesa32/src/main/imports.c index 0c2c894eef0..1623b216236 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/imports.c +++ b/reactos/dll/3rdparty/mesa32/src/main/imports.c @@ -104,7 +104,7 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment) (void) posix_memalign(& mem, alignment, bytes); return mem; -#elif defined(_WIN32) && defined(_MSC_VER) +#elif 0/*defined(_WIN32) && defined(_MSC_VER)*/ return _aligned_malloc(bytes, alignment); #else uintptr_t ptr, buf; @@ -146,7 +146,7 @@ _mesa_align_calloc(size_t bytes, unsigned long alignment) } return mem; -#elif defined(_WIN32) && defined(_MSC_VER) +#elif 0/*defined(_WIN32) && defined(_MSC_VER)*/ void *mem; mem = _aligned_malloc(bytes, alignment); diff --git a/reactos/dll/3rdparty/mesa32/src/main/imports.h b/reactos/dll/3rdparty/mesa32/src/main/imports.h index e560bc0599e..8056e3401aa 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/imports.h +++ b/reactos/dll/3rdparty/mesa32/src/main/imports.h @@ -482,10 +482,10 @@ _mesa_is_pow_two(int x) /* This function/macro is sensitive to precision. Test very carefully * if you change it! */ -#define UNCLAMPED_FLOAT_TO_UBYTE(UB, F) \ +#define UNCLAMPED_FLOAT_TO_UBYTE(UB, F_) \ do { \ fi_type __tmp; \ - __tmp.f = (F); \ + __tmp.f = (F_); \ if (__tmp.i < 0) \ UB = (GLubyte) 0; \ else if (__tmp.i >= IEEE_0996) \ @@ -495,10 +495,10 @@ _mesa_is_pow_two(int x) UB = (GLubyte) __tmp.i; \ } \ } while (0) -#define CLAMPED_FLOAT_TO_UBYTE(UB, F) \ +#define CLAMPED_FLOAT_TO_UBYTE(UB, F_) \ do { \ fi_type __tmp; \ - __tmp.f = (F) * (255.0F/256.0F) + 32768.0F; \ + __tmp.f = (F_) * (255.0F/256.0F) + 32768.0F; \ UB = (GLubyte) __tmp.i; \ } while (0) #else