Mesa (master): swr: extern declaration for win32 intrinsics

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Mar 15 13:26:42 UTC 2021


Module: Mesa
Branch: master
Commit: 31dbef02a06127ddf3365fe83f8ef04bf2362c2b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=31dbef02a06127ddf3365fe83f8ef04bf2362c2b

Author: Michel Zou <xantares09 at hotmail.com>
Date:   Wed Mar 10 21:19:20 2021 +0100

swr: extern declaration for win32 intrinsics

This fixes compilation on msvc because llvm redefines these too
Closes #4417

Reviewed-by: Jan Zielinski <jan.zielinski at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9502>

---

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

diff --git a/src/gallium/drivers/swr/rasterizer/common/os.h b/src/gallium/drivers/swr/rasterizer/common/os.h
index cc13936d8e9..b949625ae73 100644
--- a/src/gallium/drivers/swr/rasterizer/common/os.h
+++ b/src/gallium/drivers/swr/rasterizer/common/os.h
@@ -106,6 +106,7 @@ static inline void AlignedFree(void* p)
 #endif
 
 #if !defined(_WIN64)
+extern "C" {
 inline unsigned char _BitScanForward64(unsigned long* Index, uint64_t Mask)
 {
 #ifdef __GNUC__
@@ -131,6 +132,7 @@ inline unsigned char _BitScanReverse64(unsigned long* Index, uint64_t Mask)
 #endif
     return (Mask != 0);
 }
+}
 #endif
 
 #elif defined(__APPLE__) || defined(FORCE_LINUX) || defined(__linux__) || defined(__gnu_linux__)



More information about the mesa-commit mailing list