From 4c429b46d67ff7f7867ff635a05b1d612630cafc Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Tue, 20 Oct 2026 03:33:34 +0100 Subject: [PATCH] Fixed compatibility with older Windows SDKs and C runtimes --- interrupts.c | 6 +++++- main.c | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/interrupts.c b/interrupts.c index 88c9936..4b1ca15 100644 --- a/interrupts.c +++ b/interrupts.c @@ -17,6 +17,10 @@ # include # include # include + +# ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING +# define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 +# endif #else # include # include @@ -5517,7 +5521,7 @@ static void int_21 (CPU8086 *cpu) { } else if (count == 0) { #if defined (_WIN32) - if (_chsize_s (_fileno (dos_fcb_open[slot].file), position) != 0) { + if (_chsize (_fileno (dos_fcb_open[slot].file), position) != 0) { #else if (ftruncate (fileno (dos_fcb_open[slot].file), (off_t) position) != 0) { #endif diff --git a/main.c b/main.c index d15e10e..0c65571 100644 --- a/main.c +++ b/main.c @@ -8,6 +8,14 @@ #if defined (_WIN32) # include + +# ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING +# define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 +# endif + +# ifndef DISABLE_NEWLINE_AUTO_RETURN +# define DISABLE_NEWLINE_AUTO_RETURN 0x0008 +# endif #endif #include "cpu.h" -- 2.34.1