mirror of
https://github.com/RubyMetric/chsrc
synced 2025-12-25 11:59:54 +08:00
Debuging test_speed()
This commit is contained in:
16
helper.h
16
helper.h
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user