diff --git a/test/functional/fixtures/shell-test.c b/test/functional/fixtures/shell-test.c index 2a478c9bac..a25c12682c 100644 --- a/test/functional/fixtures/shell-test.c +++ b/test/functional/fixtures/shell-test.c @@ -2,9 +2,9 @@ #include #include #include -#ifdef _MSC_VER -# include -# define usleep(usecs) Sleep(usecs/1000) +#ifdef MSWIN +# include +# define usleep(usecs) Sleep((usecs) / 1000) #else # include #endif @@ -12,7 +12,7 @@ static void flush_wait(void) { fflush(NULL); - usleep(10*1000); // Wait 10 ms. + usleep(10 * 1000); // Wait 10 ms. } static void help(void) @@ -50,14 +50,14 @@ static void help(void) int main(int argc, char **argv) { +#ifdef MSWIN + SetConsoleOutputCP(CP_UTF8); +#endif + if (argc == 2 && strcmp(argv[1], "--help") == 0) { help(); } -#ifdef _MSC_VER - SetConsoleOutputCP(CP_UTF8); -#endif - if (argc >= 2) { if (strcmp(argv[1], "-t") == 0) { if (argc < 3) { @@ -75,7 +75,7 @@ int main(int argc, char **argv) } else { fprintf(stderr, "ready $ "); } -#ifndef _MSG_VER +#ifndef MSWIN } else if (strcmp(argv[1], "EXECVP") == 0) { if (argc < 4) { fprintf(stderr, "Not enough arguments for EXECVP\n");