From fe8cb4b09d514d29b347649c8b3e18abbc21d24c Mon Sep 17 00:00:00 2001 From: nickysn Date: Sun, 6 Sep 2015 23:37:04 +0000 Subject: [PATCH] + integrated the winprocs and wintypes .inc files into the win16 system unit git-svn-id: trunk@31565 - --- rtl/inc/resh.inc | 5 +++++ rtl/win16/Makefile | 2 +- rtl/win16/Makefile.fpc | 2 +- rtl/win16/system.pp | 5 +++++ rtl/win16/winprocsh.inc | 28 ++++++++++++++-------------- rtl/win16/wintypes.inc | 10 +++++----- 6 files changed, 31 insertions(+), 21 deletions(-) diff --git a/rtl/inc/resh.inc b/rtl/inc/resh.inc index cefdde5eb7..f3cf519718 100644 --- a/rtl/inc/resh.inc +++ b/rtl/inc/resh.inc @@ -2,8 +2,13 @@ type //Obsolete types, kept for backwards compatibility TResourceHandle = PtrUint; +{$ifdef Win16} + HMODULE = THandle; {HINST} + HGLOBAL = THandle; +{$else Win16} HMODULE = PtrUint; HGLOBAL = PtrUint; +{$endif Win16} //New types TFPResourceHandle = PtrUInt; TFPResourceHMODULE = PtrUInt; diff --git a/rtl/win16/Makefile b/rtl/win16/Makefile index b07528a5bb..9d3ae85d65 100644 --- a/rtl/win16/Makefile +++ b/rtl/win16/Makefile @@ -2567,7 +2567,7 @@ prt0l$(OEXT) : prt0l.asm prt0comn.asm $(COMPILER_UNITTARGETDIR) $(NASM) -f obj -o $(UNITTARGETDIRPREFIX)prt0l$(OEXT) prt0l.asm prt0h$(OEXT) : prt0h.asm prt0comn.asm $(COMPILER_UNITTARGETDIR) $(NASM) -f obj -o $(UNITTARGETDIRPREFIX)prt0h$(OEXT) prt0h.asm -system$(PPUEXT) : system.pp $(SYSDEPS) $(INC)/tnyheaph.inc $(INC)/tinyheap.inc +system$(PPUEXT) : system.pp $(SYSDEPS) $(INC)/tnyheaph.inc $(INC)/tinyheap.inc wintypes.inc winprocsh.inc winprocs.inc $(COMPILER) -Us -Sg system.pp $(EXECPPAS) uuchar$(PPUEXT): $(SYSTEMUNIT)$(PPUEXT) $(INC)/uuchar.pp diff --git a/rtl/win16/Makefile.fpc b/rtl/win16/Makefile.fpc index 3deb2ee762..a98ce074fd 100644 --- a/rtl/win16/Makefile.fpc +++ b/rtl/win16/Makefile.fpc @@ -69,7 +69,7 @@ prt0h$(OEXT) : prt0h.asm prt0comn.asm $(COMPILER_UNITTARGETDIR) # # System Units (System, Objpas, Strings) # -system$(PPUEXT) : system.pp $(SYSDEPS) $(INC)/tnyheaph.inc $(INC)/tinyheap.inc +system$(PPUEXT) : system.pp $(SYSDEPS) $(INC)/tnyheaph.inc $(INC)/tinyheap.inc wintypes.inc winprocsh.inc winprocs.inc $(COMPILER) -Us -Sg system.pp $(EXECPPAS) diff --git a/rtl/win16/system.pp b/rtl/win16/system.pp index 6aece8578d..f531c158ad 100644 --- a/rtl/win16/system.pp +++ b/rtl/win16/system.pp @@ -118,6 +118,11 @@ type {$I registers.inc} +{$define SYSTEMUNIT} +{$I wintypes.inc} +{$I winprocsh.inc} +{$I winprocs.inc} + {$I system.inc} {$I tinyheap.inc} diff --git a/rtl/win16/winprocsh.inc b/rtl/win16/winprocsh.inc index 4a63cfa209..836fead1c1 100644 --- a/rtl/win16/winprocsh.inc +++ b/rtl/win16/winprocsh.inc @@ -1,18 +1,18 @@ -function LOBYTE(w: Word): Byte; inline; -function HIBYTE(w: Word): Byte; inline; +function LOBYTE(w: Word): Byte; {$ifdef SYSTEMUNIT}forward;{$else}inline;{$endif} +function HIBYTE(w: Word): Byte; {$ifdef SYSTEMUNIT}forward;{$else}inline;{$endif} -function LOWORD(l: LongInt): Word; inline; -function HIWORD(l: LongInt): Word; inline; +function LOWORD(l: LongInt): Word; {$ifdef SYSTEMUNIT}forward;{$else}inline;{$endif} +function HIWORD(l: LongInt): Word; {$ifdef SYSTEMUNIT}forward;{$else}inline;{$endif} -function MAKELONG(low, high: Word): LONG; inline; +function MAKELONG(low, high: Word): LONG; {$ifdef SYSTEMUNIT}forward;{$else}inline;{$endif} -function MAKELPARAM(low, high: Word): LPARAM; inline; -function MAKELRESULT(low, high: Word): LRESULT; inline; +function MAKELPARAM(low, high: Word): LPARAM; {$ifdef SYSTEMUNIT}forward;{$else}inline;{$endif} +function MAKELRESULT(low, high: Word): LRESULT; {$ifdef SYSTEMUNIT}forward;{$else}inline;{$endif} -function MAKELP(sel, off: Word): FarPointer; inline; -function SELECTOROF(lp: FarPointer): Word; inline; -function OFFSETOF(lp: FarPointer): Word; inline; +function MAKELP(sel, off: Word): FarPointer; {$ifdef SYSTEMUNIT}forward;{$else}inline;{$endif} +function SELECTOROF(lp: FarPointer): Word; {$ifdef SYSTEMUNIT}forward;{$else}inline;{$endif} +function OFFSETOF(lp: FarPointer): Word; {$ifdef SYSTEMUNIT}forward;{$else}inline;{$endif} // FIELDOFFSET @@ -101,7 +101,7 @@ procedure DirectedYield(Task: HTASK); external 'KERNEL'; { Global memory management } -function GlobalDiscard(h: HGLOBAL): HGLOBAL; inline; +function GlobalDiscard(h: HGLOBAL): HGLOBAL; {$ifdef SYSTEMUNIT}forward;{$else}inline;{$endif} function GlobalAlloc(Flags: UINT; Bytes: DWORD): HGLOBAL; external 'KERNEL'; function GlobalReAlloc(Mem: HGLOBAL; Bytes: DWORD; Flags: UINT): HGLOBAL; external 'KERNEL'; @@ -137,8 +137,8 @@ procedure GlobalNotify(NotifyProc: GNOTIFYPROC); external 'KERNEL'; function LockSegment(Segment: UINT): HGLOBAL; external 'KERNEL'; procedure UnlockSegment(Segment: UINT); external 'KERNEL'; -function LockData(dummy: SmallInt): HGLOBAL; inline; -procedure UnlockData(dummy: SmallInt); inline; +function LockData(dummy: SmallInt): HGLOBAL; {$ifdef SYSTEMUNIT}forward;{$else}inline;{$endif} +procedure UnlockData(dummy: SmallInt); {$ifdef SYSTEMUNIT}forward;{$else}inline;{$endif} function AllocSelector(Selector: UINT): UINT; external 'KERNEL'; function FreeSelector(Selector: UINT): UINT; external 'KERNEL'; @@ -155,7 +155,7 @@ procedure ValidateFreeSpaces; external 'KERNEL'; { Local Memory Management } -function LocalDiscard(h: HLOCAL): HLOCAL; inline; +function LocalDiscard(h: HLOCAL): HLOCAL; {$ifdef SYSTEMUNIT}forward;{$else}inline;{$endif} function LocalAlloc(Flags, Bytes: UINT): HLOCAL; external 'KERNEL'; function LocalReAlloc(Mem: HLOCAL; Bytes, Flags: UINT): HLOCAL; external 'KERNEL'; diff --git a/rtl/win16/wintypes.inc b/rtl/win16/wintypes.inc index ec45b1a40d..7b7343c9ea 100644 --- a/rtl/win16/wintypes.inc +++ b/rtl/win16/wintypes.inc @@ -18,7 +18,7 @@ type is better to be avoided. } PSTR = ^Char; NPSTR = ^Char; near; - LPSTR = ^Char; far; +// LPSTR = ^Char; far; LPCSTR = ^Char; far; { PBYTE is already defined in system } @@ -45,7 +45,7 @@ type SPHANDLE = ^THandle; near; LPHANDLE = ^THandle; far; - HGLOBAL = THandle; +// HGLOBAL = THandle; HLOCAL = THandle; TGlobalHandle = THandle; @@ -55,7 +55,7 @@ type TAtom = ATOM; HINST = THandle; { instead of HINSTANCE, to avoid conflict with var hInstance } - HMODULE = HINST; +// HMODULE = HINST; const { GetWinFlags result mask values } @@ -202,8 +202,8 @@ const OF_REOPEN = $8000; { _lopen() flags } - READ = 0; - WRITE = 1; + _READ = 0; + _WRITE = 1; READ_WRITE = 2; { _llseek origin values }