Browse Source

+ integrated the winprocs and wintypes .inc files into the win16 system unit

git-svn-id: trunk@31565 -
nickysn 10 years ago
parent
commit
fe8cb4b09d
6 changed files with 31 additions and 21 deletions
  1. 5 0
      rtl/inc/resh.inc
  2. 1 1
      rtl/win16/Makefile
  3. 1 1
      rtl/win16/Makefile.fpc
  4. 5 0
      rtl/win16/system.pp
  5. 14 14
      rtl/win16/winprocsh.inc
  6. 5 5
      rtl/win16/wintypes.inc

+ 5 - 0
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;

+ 1 - 1
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

+ 1 - 1
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)
 

+ 5 - 0
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}

+ 14 - 14
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';

+ 5 - 5
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 }