Re: include[1/2]: add a strcmpW-equivalent function usable in tests.
Mikołaj Zalewski <mikolaj(a)zalewski.pl> wrote:
+/* strcmpW is avaiable for tests compiled under Wine, but not in standalone + * builds under Windows, so we reimplement it under a different name. */ +static inline int winetest_strcmpW( const WCHAR *str1, const WCHAR *str2 ) +{ + while (*str1 && (*str1 == *str2)) { str1++; str2++; } + return *str1 - *str2; +}
'inline' should not be used in Wine tests, and existing 'inline's should be removed since that's not a valid modifier for MSVC, and we can't include config.h in tests. -- Dmitry.
2010/2/22 Dmitry Timoshkov <dmitry(a)codeweavers.com>:
Mikołaj Zalewski <mikolaj(a)zalewski.pl> wrote:
+/* strcmpW is avaiable for tests compiled under Wine, but not in standalone + * builds under Windows, so we reimplement it under a different name. */ +static inline int winetest_strcmpW( const WCHAR *str1, const WCHAR *str2 ) +{ + while (*str1 && (*str1 == *str2)) { str1++; str2++; } + return *str1 - *str2; +}
'inline' should not be used in Wine tests, and existing 'inline's should be removed since that's not a valid modifier for MSVC, and we can't include config.h in tests. Inline is already present in include/wine/test.h - in wine_dbgstr_w. To compile tests under Visual C++, I use "#define inline" or add this define to project properties.
Mikołaj
participants (2)
-
Dmitry Timoshkov -
Mikołaj Zalewski