From 0203d1778ac4f7c73d6e390924f080615297d9cc Mon Sep 17 00:00:00 2001 From: Justin Miller Date: Thu, 29 Jan 2026 14:30:34 -0800 Subject: [PATCH] [WINED3D] FFS has to return correct values on both msvc and gcc (#8625) accordingly to https://www.man7.org/linux/man-pages/man3/ffs.3.html we have been doing this wrong for awhile and it causes opengl to freeze --- sdk/include/wine/port.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/include/wine/port.h b/sdk/include/wine/port.h index a10d6c53b43..58276e6ddaa 100644 --- a/sdk/include/wine/port.h +++ b/sdk/include/wine/port.h @@ -354,7 +354,7 @@ ffs(int mask) { long index; if (_BitScanForward(&index, mask) == 0) return 0; - return index; + return index + 1; } #else #define ffs __builtin_ffs