fixed: macro definitions

This commit is contained in:
Sven Vogel 2024-06-05 11:59:03 +02:00
parent f9a18fc107
commit b75ff7e44f
2 changed files with 3 additions and 4 deletions

View File

@ -13,6 +13,8 @@
#define MAX_PATH_BYTES PATH_MAX #define MAX_PATH_BYTES PATH_MAX
#define min(a, b) ((a) > (b) ? (b) : (a))
#elif defined(_WIN32) || defined(WIN32) #elif defined(_WIN32) || defined(WIN32)
#include <Windows.h> #include <Windows.h>
@ -69,8 +71,6 @@ void delete_files(ModuleFileStack *stack) {
// seeking the current line in print_diagnostic() // seeking the current line in print_diagnostic()
#define SEEK_BUF_BYTES 256 #define SEEK_BUF_BYTES 256
#define min(a, b) ((a) > (b) ? (b) : (a))
// behaves like fgets except that it has defined behavior when n == 1 // behaves like fgets except that it has defined behavior when n == 1
static void custom_fgets(char *buffer, size_t n, FILE *stream) { static void custom_fgets(char *buffer, size_t n, FILE *stream) {
if (n == 1) { if (n == 1) {

View File

@ -71,8 +71,7 @@ int stdout_supports_ansi_esc() {
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
if (!GetConsoleMode(hConsole, &mode)) { if (!GetConsoleMode(hConsole, &mode)) {
ERROR("failed to get console mode"); return ASNI_DISABLED;
return ANSI_ENABLED;
} }
if ((mode & ENABLE_VIRTUAL_TERMINAL_INPUT) | if ((mode & ENABLE_VIRTUAL_TERMINAL_INPUT) |