mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-08 11:14:03 +08:00
Add global variable to check system
This commit is contained in:
parent
83429a9b4e
commit
2d6e77605b
13
helper.h
13
helper.h
@ -20,12 +20,25 @@
|
|||||||
// #define NDEBUG
|
// #define NDEBUG
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
|
static bool xy_on_windows = true;
|
||||||
|
static bool xy_on_linux = false;
|
||||||
|
static bool xy_on_macos = false;
|
||||||
|
static bool xy_on_bsds = false;
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define xy_useutf8() SetConsoleOutputCP(65001)
|
#define xy_useutf8() SetConsoleOutputCP(65001)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
static bool xy_on_windows = false;
|
||||||
|
static bool xy_on_linux = true;
|
||||||
|
static bool xy_on_macos = false;
|
||||||
|
static bool xy_on_bsds = false;
|
||||||
|
|
||||||
#define xy_useutf8()
|
#define xy_useutf8()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define Array_Size(x) (sizeof(x) / sizeof(x[0]))
|
#define Array_Size(x) (sizeof(x) / sizeof(x[0]))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user