From 2131196402cf1e1b8204a544cb52e84edf7d39ee Mon Sep 17 00:00:00 2001 From: Tomas Hajny <hajny@freepascal.org> Date: Wed, 15 Sep 2004 19:20:51 +0000 Subject: [PATCH] * dxegen compilable for any target now --- rtl/go32v2/Makefile | 5 +++-- rtl/go32v2/Makefile.fpc | 6 ++++-- rtl/go32v2/dxeload.pp | 21 +++++++-------------- rtl/go32v2/dxetype.pp | 42 +++++++++++++++++++++++++++++++++++++++++ utils/dxegen/dxegen.pp | 22 +++++++++++---------- 5 files changed, 68 insertions(+), 28 deletions(-) create mode 100644 rtl/go32v2/dxetype.pp diff --git a/rtl/go32v2/Makefile b/rtl/go32v2/Makefile index ff784f6e3a..584f237a4b 100644 --- a/rtl/go32v2/Makefile +++ b/rtl/go32v2/Makefile @@ -231,7 +231,7 @@ endif ifdef NO_EXCEPTIONS_IN_SYSTEM override FPCOPT+=-dNO_EXCEPTIONS_IN_SYSTEM endif -override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils +override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils override TARGET_LOADERS+=prt0 exceptn fpu override TARGET_RSTS+=math varutils typinfo classes variants dateutil sysconst override INSTALL_FPCPACKAGE=y @@ -1414,7 +1414,8 @@ dpmiexcp$(PPUEXT) : dpmiexcp.pp exceptn$(OEXT) system$(PPUEXT) $(COMPILER) -Sg dpmiexcp.pp initc$(PPUEXT) : initc.pp system$(PPUEXT) profile$(PPUEXT) : profile.pp dpmiexcp$(PPUEXT) go32$(PPUEXT) -dxeload$(PPUEXT) : dxeload.pp system$(PPUEXT) +dxetype$(PPUEXT) : dxetype.pp system$(PPUEXT) +dxeload$(PPUEXT) : dxeload.pp dxetype$(PPUEXT) system$(PPUEXT) emu387$(PPUEXT) : emu387.pp fpu$(OEXT) strings$(PPUEXT) dxeload$(PPUEXT) \ dpmiexcp$(PPUEXT) ports$(PPUEXT) : ports.pp objpas$(PPUEXT) system$(PPUEXT) diff --git a/rtl/go32v2/Makefile.fpc b/rtl/go32v2/Makefile.fpc index 4cf72d9077..6323f22f2a 100644 --- a/rtl/go32v2/Makefile.fpc +++ b/rtl/go32v2/Makefile.fpc @@ -8,7 +8,7 @@ main=rtl [target] loaders=prt0 exceptn fpu units=system objpas macpas strings \ - go32 dpmiexcp initc ports profile dxeload emu387 \ + go32 dpmiexcp initc ports profile dxetype dxeload emu387 \ dos crt objects printer graph \ sysutils classes math typinfo matrix \ cpu mmx ucomplex getopts heaptrc lineinfo \ @@ -114,7 +114,9 @@ initc$(PPUEXT) : initc.pp system$(PPUEXT) profile$(PPUEXT) : profile.pp dpmiexcp$(PPUEXT) go32$(PPUEXT) -dxeload$(PPUEXT) : dxeload.pp system$(PPUEXT) +dxetype$(PPUEXT) : dxetype.pp system$(PPUEXT) + +dxeload$(PPUEXT) : dxeload.pp dxetype$(PPUEXT) system$(PPUEXT) emu387$(PPUEXT) : emu387.pp fpu$(OEXT) strings$(PPUEXT) dxeload$(PPUEXT) \ dpmiexcp$(PPUEXT) diff --git a/rtl/go32v2/dxeload.pp b/rtl/go32v2/dxeload.pp index 99c12a723c..88cb4dc997 100644 --- a/rtl/go32v2/dxeload.pp +++ b/rtl/go32v2/dxeload.pp @@ -20,20 +20,13 @@ Unit dxeload; interface -const - DXE_MAGIC = $31455844; -type - dxe_header = record - magic, - symbol_offset, - element_size, - nrelocs : cardinal; - end; - function dxe_load(filename : string) : pointer; implementation +uses + dxetype; + function dxe_load(filename : string) : pointer; { Copyright (C) 1995 Charles Sandmann (sandmann@clio.rice.edu) @@ -43,9 +36,6 @@ type { to avoid range check problems } pointer_array = array[0..maxlongint div sizeof(pointer)] of pointer; tpa = ^pointer_array; - plongint = ^longint; - pcardinal = ^cardinal; - ppointer = ^pointer; var dh : dxe_header; data : pchar; @@ -98,7 +88,10 @@ end; end. { $Log$ - Revision 1.6 2002-09-07 16:01:18 peter + Revision 1.7 2004-09-15 19:20:51 hajny + * dxegen compilable for any target now + + Revision 1.6 2002/09/07 16:01:18 peter * old logs removed and tabs fixed Revision 1.5 2002/04/27 07:58:23 peter diff --git a/rtl/go32v2/dxetype.pp b/rtl/go32v2/dxetype.pp new file mode 100644 index 0000000000..86f6f29456 --- /dev/null +++ b/rtl/go32v2/dxetype.pp @@ -0,0 +1,42 @@ +{ + $Id$ + This file is part of the Free Pascal run time library. + Copyright (c) 1999-2000 by Pierre Muller, + member of the Free Pascal development team. + + Support unit for working with DXE files for Go32V2 + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + ********************************************************************** +} + +unit dxetype; + +interface + +const + DXE_MAGIC = $31455844; + +type + dxe_header = record + magic, + symbol_offset, + element_size, + nrelocs : cardinal; + end; + +implementation + +end. +{ + $Log$ + Revision 1.1 2004-09-15 19:20:51 hajny + * dxegen compilable for any target now + +} diff --git a/utils/dxegen/dxegen.pp b/utils/dxegen/dxegen.pp index a5519b1e3e..7e111f757d 100644 --- a/utils/dxegen/dxegen.pp +++ b/utils/dxegen/dxegen.pp @@ -12,7 +12,7 @@ } -Uses Strings,DxeLoad,Coff,Dos; +Uses strings,dxetype,coff,dos; {$inline on} @@ -36,15 +36,15 @@ isn't interpretive. Until generics, this is the only reusable way. } -{$ifdef BigEndian} +{$ifdef FPC_BIG_ENDIAN} Var data : pbyte; c : byte; i,j : longint; -{$endif} +{$endif FPC_BIG_ENDIAN} Begin - {$ifdef BigEndian} + {$ifdef FPC_BIG_ENDIAN} I := 1; j := length(pattern); data := pbyte(vdata); @@ -75,7 +75,7 @@ Begin End; inc(i); End; - {$endif} + {$endif FPC_BIG_ENDIAN} End; Var blaat : pointer; @@ -211,7 +211,7 @@ Begin BlockRead(input_f,sc,SCNHSZ); dosswap(@sc, '8llllllssl'); dh.magic := DXE_MAGIC; - dh.symbol_offset := -1; + dh.symbol_offset := cardinal (-1); dh.element_size := sc.s_size; dh.nrelocs := sc.s_nreloc; Getmem(Data,sc.s_size); @@ -249,7 +249,7 @@ Begin End; If (strlcomp(name, argv[2], strlen(argv[2])) = 0) Then Begin - If (dh.symbol_offset <> -1) Then + If (dh.symbol_offset <> cardinal (-1)) Then Begin Writeln('Error: multiple symbols that start with ',paramstr(2),' (',name, ')!'); @@ -266,7 +266,7 @@ Begin (* plus increment for found value. *) End; - If (dh.symbol_offset = -1) Then + If (dh.symbol_offset = cardinal (-1)) Then Begin Writeln('Error: symbol ',argv[2],' not found!'); Inc(Errors); @@ -312,7 +312,10 @@ Begin End. { $Log$ - Revision 1.7 2004-09-15 08:35:39 michael + Revision 1.8 2004-09-15 19:20:51 hajny + * dxegen compilable for any target now + + Revision 1.7 2004/09/15 08:35:39 michael + Fix for wrong for loop variable from Tomas Hajny Revision 1.6 2002/09/07 15:40:31 peter @@ -325,4 +328,3 @@ End. * Renamefest } -