@@ -62,7 +62,8 @@ bool xy_enable_color = true;
6262// #define NDEBUG
6363
6464#ifdef _WIN32
65- #define XY_On_Windows 1
65+ #define XY_Build_On_Windows 1
66+
6667 #define xy_on_windows true
6768 #define xy_on_linux false
6869 #define xy_on_macos false
@@ -73,7 +74,9 @@ bool xy_enable_color = true;
7374 #define xy_use_utf8 () SetConsoleOutputCP (65001)
7475
7576#elif defined(__linux__ ) || defined(__linux )
76- #define XY_On_Linux 1
77+ #define XY_Build_On_Linux 1
78+ #define XY_Build_On_Unix 1
79+
7780 #define xy_on_windows false
7881 #define xy_on_linux true
7982 #define xy_on_macos false
@@ -82,7 +85,9 @@ bool xy_enable_color = true;
8285 #define xy_use_utf8 ()
8386
8487#elif defined(__APPLE__ )
85- #define XY_On_macOS 1
88+ #define XY_Build_On_macOS 1
89+ #define XY_Build_On_Unix 1
90+
8691 #define xy_on_windows false
8792 #define xy_on_linux false
8893 #define xy_on_macos true
@@ -91,7 +96,9 @@ bool xy_enable_color = true;
9196 #define xy_use_utf8 ()
9297
9398#elif defined(__OpenBSD__ ) || defined(__NetBSD__ ) || defined(__FreeBSD__ )
94- #define XY_On_BSD 1
99+ #define XY_Build_On_BSD 1
100+ #define XY_Build_On_Unix 1
101+
95102 #define xy_on_windows false
96103 #define xy_on_linux false
97104 #define xy_on_macos false
@@ -916,7 +923,7 @@ _xy_os_home ()
916923static char *
917924_xy_win_documents ()
918925{
919- #ifdef XY_On_Windows
926+ #ifdef XY_Build_On_Windows
920927 char documents_path [MAX_PATH ];
921928 HRESULT result = SHGetFolderPathA (NULL , CSIDL_MYDOCUMENTS , NULL ,
922929 SHGFP_TYPE_CURRENT , documents_path );
@@ -1009,7 +1016,7 @@ xy_dir_exist (const char *path)
10091016
10101017 if (xy_on_windows )
10111018 {
1012- #ifdef XY_On_Windows
1019+ #ifdef XY_Build_On_Windows
10131020 // 也可以用 opendir() #include <dirent.h>
10141021 DWORD attr = GetFileAttributesA (dir );
10151022
0 commit comments