重命名为 XY_Build_On_xx

This commit is contained in:
Aoran Zeng
2025-08-20 22:05:07 +08:00
parent 9d7543b681
commit e6d512eb83
5 changed files with 20 additions and 13 deletions

View File

@@ -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);