diff --git a/libs/compiler/compiler.c b/libs/compiler/compiler.c index c03d87ade..a830f7999 100644 --- a/libs/compiler/compiler.c +++ b/libs/compiler/compiler.c @@ -25,7 +25,7 @@ #include "syntax.h" #include "uniio.h" -#ifndef _MSC_VER +#ifndef _WIN32 #include #include #endif @@ -44,7 +44,7 @@ typedef int (*encoder)(const workspace *const ws, syntax *const sx); /** Make executable actually executable on best-effort basis (if possible) */ static inline void make_executable(const char *const path) { -#ifndef _MSC_VER +#ifndef _WIN32 struct stat stat_buf; if (stat(path, &stat_buf)) diff --git a/libs/utils/logger.c b/libs/utils/logger.c index 97e2242db..89646b8b3 100644 --- a/libs/utils/logger.c +++ b/libs/utils/logger.c @@ -20,7 +20,7 @@ #include #include "utf8.h" -#ifdef _MSC_VER +#ifdef _WIN32 #include static const uint8_t COLOR_TAG = 0x0F; @@ -61,7 +61,7 @@ static logger current_note_log = &default_note_log; static inline void set_color(const uint8_t color) { #if defined(NDEBUG) || !defined(__APPLE__) - #ifdef _MSC_VER + #ifdef _WIN32 SetConsoleTextAttribute(GetStdHandle(STD_ERROR_HANDLE), color); #else fprintf(stderr, "\x1B[1;%im", color); @@ -101,7 +101,7 @@ static inline void print_msg(const uint8_t color, const char *const msg) while (msg[j] != '^') { -#ifdef _MSC_VER +#ifdef _WIN32 fprintf(stderr, "%c", msg[i++]); #else for (size_t k = utf8_symbol_size(msg[i]); k > 0; k--) @@ -116,7 +116,7 @@ static inline void print_msg(const uint8_t color, const char *const msg) set_color(color); while (msg[j] != '\0') { -#ifdef _MSC_VER +#ifdef _WIN32 fprintf(stderr, "%c", msg[i++]); #else for (size_t k = utf8_symbol_size(msg[i]); k > 0; k--) @@ -146,7 +146,7 @@ static inline void default_log(const char *const tag, const char *const msg, con fprintf(stderr, "%s: ", tag); set_color(color); -#ifdef _MSC_VER +#ifdef _WIN32 char buffer[MAX_MSG_SIZE]; utf8_to_cp866(tag_log, buffer); fprintf(stderr, "%s: ", buffer); @@ -154,7 +154,7 @@ static inline void default_log(const char *const tag, const char *const msg, con fprintf(stderr, "%s: ", tag_log); #endif -#ifdef _MSC_VER +#ifdef _WIN32 utf8_to_cp866(msg, buffer); print_msg(color, buffer); #else diff --git a/libs/utils/uniio.c b/libs/utils/uniio.c index 5f41ffe14..a74556158 100644 --- a/libs/utils/uniio.c +++ b/libs/utils/uniio.c @@ -20,7 +20,7 @@ #include #include "workspace.h" -#ifdef _MSC_VER +#ifdef _WIN32 #include extern intptr_t _get_osfhandle(int fd); @@ -192,7 +192,7 @@ static int out_func_user(universal_io *const io, const char *const format, va_li static inline size_t io_get_path(FILE *const file, char *const buffer) { -#ifdef _MSC_VER +#ifdef _WIN32 GetFinalPathNameByHandleA((HANDLE)_get_osfhandle(_fileno(file)), buffer, MAX_PATH, FILE_NAME_NORMALIZED); size_t ret = 0; diff --git a/libs/utils/workspace.c b/libs/utils/workspace.c index c554c66dd..f21a95c29 100644 --- a/libs/utils/workspace.c +++ b/libs/utils/workspace.c @@ -17,7 +17,7 @@ #include "workspace.h" #include -#ifndef _MSC_VER +#ifndef _WIN32 #include #else #define F_OK 0