Skip to content

Commit ab3cac6

Browse files
ecm-pushbxPerditionC
authored andcommitted
allow gcc build to succeed with -DWIN31SUPPORT
1 parent 42d3ae6 commit ab3cac6

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

hdr/win.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ struct WinStartupInfo
1818
ULONG optInstanceTable; /* used only if winver set to 0x400 (w95)*/
1919
};
2020
extern struct WinStartupInfo winStartupInfo;
21+
#if defined __GNUC__
22+
extern UWORD winseg1, winseg2, winseg3;
23+
extern UBYTE markEndInstanceData;
24+
extern struct lol ASM FAR DATASTART;
25+
#endif
26+
2127

2228
/* contains a list of offsets relative to DOS data segment of
2329
various internal variables.

kernel/inthndlr.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,6 +2001,11 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr)
20012001
r.es = FP_SEG(&winStartupInfo);
20022002
r.BX = FP_OFF(&winStartupInfo);
20032003
winStartupInfo.winver = r.di; /* match what caller says it is */
2004+
#if defined __GNUC__
2005+
winseg1 = FP_SEG(&winStartupInfo);
2006+
winseg2 = FP_SEG(&DATASTART);
2007+
winseg3 = FP_OFF(&markEndInstanceData);
2008+
#endif
20042009
winInstanced = 1; /* internal flag marking Windows is active */
20052010
DebugPrintf(("Win startup\n"));
20062011
break;

kernel/kernel.asm

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,11 +621,25 @@ _winStartupInfo:
621621
dd 0 ; next startup info structure, 0:0h marks end
622622
dd 0 ; far pointer to name virtual device file or 0:0h
623623
dd 0 ; far pointer, reference data for virtual device driver
624+
%ifnidni __OUTPUT_FORMAT__, elf
624625
dw instance_table,seg instance_table ; array of instance data
626+
%else
627+
dw instance_table ; array of instance data
628+
global _winseg1
629+
_winseg1: dw 0
630+
%endif
625631
instance_table: ; should include stacks, Win may auto determine SDA region
626632
; we simply include whole DOS data segment
633+
%ifnidni __OUTPUT_FORMAT__, elf
627634
dw seg _DATASTART, 0 ; [SEG:OFF] address of region's base
628-
dw markEndInstanceData wrt seg _DATASTART ; size in bytes
635+
dw _markEndInstanceData wrt seg _DATASTART ; size in bytes
636+
%else
637+
global _winseg2
638+
_winseg2: dw 0
639+
dw 0 ; [SEG:OFF] address of region's base
640+
global _winseg3
641+
_winseg3: dw 0 ; size in bytes
642+
%endif
629643
dd 0 ; 0 marks end of table
630644
dw 0 ; and 0 length for end of instance_table entry
631645
global _winPatchTable
@@ -989,7 +1003,8 @@ segment DYN_DATA
9891003
_Dyn:
9901004
DynAllocated dw 0
9911005

992-
markEndInstanceData: ; mark end of DOS data seg we say needs instancing
1006+
global _markEndInstanceData
1007+
_markEndInstanceData: ; mark end of DOS data seg we say needs instancing
9931008

9941009
9951010
segment ID_B

0 commit comments

Comments
 (0)