Debuging test_speed()

This commit is contained in:
Aoran Zeng
2023-09-02 21:36:54 +08:00
parent 4a6f24a258
commit 2c62dedd5c
2 changed files with 52 additions and 17 deletions

View File

@@ -26,6 +26,8 @@
static bool xy_on_macos = false;
static bool xy_on_bsds = false;
static char* xy_os_devnull = "nul";
#include <windows.h>
#define xy_useutf8() SetConsoleOutputCP(65001)
@@ -35,6 +37,8 @@
static bool xy_on_macos = false;
static bool xy_on_bsds = false;
static char* xy_os_devnull = "/dev/null"
#define xy_useutf8()
#endif
@@ -212,4 +216,16 @@ xy_streql(const char* str1, const char* str2) {
return strcmp(str1, str2) == 0 ? true : false;
}
char*
xy_str_to_quietcmd (const char* cmd)
{
char* ret = NULL;
#ifdef _WIN32
ret = xy_2strjoin (cmd, " >nul 2>nul");
#else
ret = xy_2strjoin (cmd, " 1>/dev/null 2>&1");
#endif
}
#endif