Fixed compatibility with older Windows SDKs and C runtimes
authorRobert Pengelly <robertapengelly@hotmail.com>
Tue, 20 Oct 2026 02:33:34 +0000 (03:33 +0100)
committerRobert Pengelly <robertapengelly@hotmail.com>
Tue, 20 Oct 2026 02:33:34 +0000 (03:33 +0100)
interrupts.c
main.c

index 88c9936ce9bd8f10bb9d1b8962cfb79e01fdcb8c..4b1ca15f162b3c345f37e131388c46c89be60978 100644 (file)
 # include       <direct.h>
 # include       <io.h>
 # include       <windows.h>
+
+# ifndef    ENABLE_VIRTUAL_TERMINAL_PROCESSING
+#  define       ENABLE_VIRTUAL_TERMINAL_PROCESSING          0x0004
+# endif
 #else
 # include       <sys/select.h>
 # include       <sys/statvfs.h>
@@ -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 d15e10e2468c619654e7111aa3377b00fd86f8b9..0c65571d9fa0c8d1db9ac16af997df9b59b778f3 100644 (file)
--- a/main.c
+++ b/main.c
@@ -8,6 +8,14 @@
 
 #if     defined (_WIN32)
 # include       <windows.h>
+
+# 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"