Fixes building tests in Visual Studio with msvc's own crt headers.
---
This follows patches in other places that replaced it first with _strnicmp(a, b, -1), and later with _stricmp(a, b), because _strnicmp with size=-1 raises a runtime error.
From: Stefan D��singer stefan@codeweavers.com
Fixes building tests in Visual Studio with msvc's own crt headers.
---
This follows patches in other places that replaced it first with _strnicmp(a, b, -1), and later with _stricmp(a, b), because _strnicmp with size=-1 raises a runtime error. --- include/wine/test.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/wine/test.h b/include/wine/test.h index 3782c6eeeb6..81527eef5f2 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -679,7 +679,7 @@ int main( int argc, char **argv )
if (GetEnvironmentVariableA( "WINETEST_COLOR", p, sizeof(p) )) { - BOOL automode = !strcasecmp(p, "auto"); + BOOL automode = !_stricmp(p, "auto"); winetest_color = automode ? isatty( fileno( stdout ) ) : atoi(p); /* enable ANSI support for Windows console */ if (winetest_color)
From: Stefan D��singer stefan@codeweavers.com
Msvc does not support it.
---
According to Wikipedia, it is not standard C, citing
https://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.10.pdf
which in turn says "Proposals to add '\e' for ASCII ESC ('\033') were not adopted because other popular character sets have no obvious equivalent" --- include/wine/test.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/wine/test.h b/include/wine/test.h index 81527eef5f2..aeb1afd3c39 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -281,12 +281,12 @@ const char *winetest_elapsed(void) return wine_dbg_sprintf( "%.3f", (now - winetest_start_time) / 1000.0); }
-static const char color_reset[] = "\e[0m"; -static const char color_dark_red[] = "\e[31m"; -static const char color_green[] = "\e[32m"; -static const char color_yellow[] = "\e[33m"; -static const char color_blue[] = "\e[34m"; -static const char color_bright_red[] = "\e[1;91m"; +static const char color_reset[] = "\x1b[0m"; +static const char color_dark_red[] = "\x1b[31m"; +static const char color_green[] = "\x1b[32m"; +static const char color_yellow[] = "\x1b[33m"; +static const char color_blue[] = "\x1b[34m"; +static const char color_bright_red[] = "\x1b[1;91m";
static void winetest_printf( const char *msg, ... ) __WINE_PRINTF_ATTR(1,2); static void winetest_printf( const char *msg, ... )
Alexandre Julliard (@julliard) commented about include/wine/test.h:
if (GetEnvironmentVariableA( "WINETEST_COLOR", p, sizeof(p) )) {
BOOL automode = !strcasecmp(p, "auto");
BOOL automode = !_stricmp(p, "auto");
I don't think there's any reason to make that variable case insensitive. WINETEST_PLATFORM isn't.