From 47b5083e50554410a861d1cde309d77d9078fc46 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 20 Jun 2011 13:15:58 +0000 Subject: [PATCH] [WINE] add inline version of ffs svn path=/trunk/; revision=52382 --- reactos/include/reactos/wine/port.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reactos/include/reactos/wine/port.h b/reactos/include/reactos/wine/port.h index 62e64e77379..97692bbf30f 100644 --- a/reactos/include/reactos/wine/port.h +++ b/reactos/include/reactos/wine/port.h @@ -315,6 +315,17 @@ extern int spawnvp(int mode, const char *cmdname, const char * const argv[]); #endif /* __i386___ && __GNUC__ */ +#if defined(_MSC_VER) +__forceinline +int +ffs(int mask) +{ + long index; + if (_BitScanForward(&index, mask) == 0) return 0; + return index; +} +#endif + #else /* NO_LIBWINE_PORT */ #define __WINE_NOT_PORTABLE(func) func##_is_not_portable func##_is_not_portable