mirror of
https://github.com/RubyMetric/chsrc
synced 2025-10-10 06:03:24 +08:00
重命名为 XY_Build_On_xx
This commit is contained in:
19
lib/xy.h
19
lib/xy.h
@@ -62,7 +62,8 @@ bool xy_enable_color = true;
|
||||
// #define NDEBUG
|
||||
|
||||
#ifdef _WIN32
|
||||
#define XY_On_Windows 1
|
||||
#define XY_Build_On_Windows 1
|
||||
|
||||
#define xy_on_windows true
|
||||
#define xy_on_linux false
|
||||
#define xy_on_macos false
|
||||
@@ -73,7 +74,9 @@ bool xy_enable_color = true;
|
||||
#define xy_use_utf8() SetConsoleOutputCP (65001)
|
||||
|
||||
#elif defined(__linux__) || defined(__linux)
|
||||
#define XY_On_Linux 1
|
||||
#define XY_Build_On_Linux 1
|
||||
#define XY_Build_On_Unix 1
|
||||
|
||||
#define xy_on_windows false
|
||||
#define xy_on_linux true
|
||||
#define xy_on_macos false
|
||||
@@ -82,7 +85,9 @@ bool xy_enable_color = true;
|
||||
#define xy_use_utf8()
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
#define XY_On_macOS 1
|
||||
#define XY_Build_On_macOS 1
|
||||
#define XY_Build_On_Unix 1
|
||||
|
||||
#define xy_on_windows false
|
||||
#define xy_on_linux false
|
||||
#define xy_on_macos true
|
||||
@@ -91,7 +96,9 @@ bool xy_enable_color = true;
|
||||
#define xy_use_utf8()
|
||||
|
||||
#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
|
||||
#define XY_On_BSD 1
|
||||
#define XY_Build_On_BSD 1
|
||||
#define XY_Build_On_Unix 1
|
||||
|
||||
#define xy_on_windows false
|
||||
#define xy_on_linux false
|
||||
#define xy_on_macos false
|
||||
@@ -916,7 +923,7 @@ _xy_os_home ()
|
||||
static char *
|
||||
_xy_win_documents ()
|
||||
{
|
||||
#ifdef XY_On_Windows
|
||||
#ifdef XY_Build_On_Windows
|
||||
char documents_path[MAX_PATH];
|
||||
HRESULT result = SHGetFolderPathA (NULL, CSIDL_MYDOCUMENTS, NULL,
|
||||
SHGFP_TYPE_CURRENT, documents_path);
|
||||
@@ -1009,7 +1016,7 @@ xy_dir_exist (const char *path)
|
||||
|
||||
if (xy_on_windows)
|
||||
{
|
||||
#ifdef XY_On_Windows
|
||||
#ifdef XY_Build_On_Windows
|
||||
// 也可以用 opendir() #include <dirent.h>
|
||||
DWORD attr = GetFileAttributesA (dir);
|
||||
|
||||
|
Reference in New Issue
Block a user