From 2d6e77605be2d4eb9c86750d87a4b07f2203d333 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Wed, 30 Aug 2023 17:09:59 +0800 Subject: [PATCH] Add global variable to check system --- helper.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/helper.h b/helper.h index ce9900c..f0ac1ce 100644 --- a/helper.h +++ b/helper.h @@ -20,12 +20,25 @@ // #define NDEBUG #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 #define xy_useutf8() SetConsoleOutputCP(65001) + #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() #endif + #define Array_Size(x) (sizeof(x) / sizeof(x[0]))