From 78d13ec796021a6e125ad9fec981f639dbfe5d8f Mon Sep 17 00:00:00 2001 From: florian Date: Tue, 4 May 1999 21:44:30 +0000 Subject: [PATCH] * changes to compile it with Delphi 4.0 --- compiler/ag386bin.pas | 7 +++-- compiler/ag386int.pas | 15 +++++++--- compiler/ag386nsm.pas | 15 +++++++--- compiler/assemble.pas | 8 +++++- compiler/cg386set.pas | 17 ++++++++++-- compiler/comphook.pas | 9 +++++- compiler/compiler.pas | 8 +++++- compiler/comprsrc.pas | 12 +++++++- compiler/dmisc.pas | 13 +++++---- compiler/files.pas | 8 +++++- compiler/globals.pas | 37 ++++++++++++++++++++++++- compiler/link.pas | 8 +++++- compiler/mppc386.bat | 2 +- compiler/msgtxt.inc | 6 +++- compiler/og386.pas | 8 +++++- compiler/os2_targ.pas | 11 ++++++-- compiler/owar.pas | 10 +++++-- compiler/pdecl.pas | 9 ++++-- compiler/pexports.pas | 7 +++-- compiler/pexpr.pas | 64 +++++++++++++++++++++++++------------------ compiler/ppc.dpr | 7 ++++- compiler/ppu.pas | 13 +++++++-- compiler/ra386att.pas | 7 +++-- compiler/ra386int.pas | 7 +++-- compiler/scanner.pas | 8 +++++- compiler/symppu.inc | 9 ++++-- compiler/symsym.inc | 7 ++++- compiler/tpexcept.pas | 21 ++++++++++++-- compiler/verbose.pas | 15 ++++++---- 29 files changed, 286 insertions(+), 82 deletions(-) diff --git a/compiler/ag386bin.pas b/compiler/ag386bin.pas index a864635e10..c00b2c11b0 100644 --- a/compiler/ag386bin.pas +++ b/compiler/ag386bin.pas @@ -78,7 +78,7 @@ unit ag386bin; var ofs, nidx,nother,i,line,j : longint; - code : word; + code : integer; hp : pchar; reloc : boolean; sec : tsection; @@ -662,7 +662,10 @@ unit ag386bin; end. { $Log$ - Revision 1.1 1999-05-01 13:23:57 peter + Revision 1.2 1999-05-04 21:44:30 florian + * changes to compile it with Delphi 4.0 + + Revision 1.1 1999/05/01 13:23:57 peter * merged nasm compiler * old asm moved to oldasm/ diff --git a/compiler/ag386int.pas b/compiler/ag386int.pas index 1bd33068c8..f20a74ed43 100644 --- a/compiler/ag386int.pas +++ b/compiler/ag386int.pas @@ -99,11 +99,15 @@ unit ag386int; c : comp; dd : pdouble; begin - {$ifdef TP} +{$ifdef TP} c:=d; - {$else} +{$else TP} +{$ifdef Delphi} + c:=d; +{$else Delphi} c:=comp(d); - {$endif} +{$endif Delphi} +{$endif TP} dd:=pdouble(@c); { this makes a bitwise copy of c into a double } comp2str:=double2str(dd^); end; @@ -769,7 +773,10 @@ ait_stab_function_name : ; end. { $Log$ - Revision 1.35 1999-05-02 22:41:49 peter + Revision 1.36 1999-05-04 21:44:31 florian + * changes to compile it with Delphi 4.0 + + Revision 1.35 1999/05/02 22:41:49 peter * moved section names to systems * fixed nasm,intel writer diff --git a/compiler/ag386nsm.pas b/compiler/ag386nsm.pas index 88e10a940e..88b4546756 100644 --- a/compiler/ag386nsm.pas +++ b/compiler/ag386nsm.pas @@ -99,11 +99,15 @@ unit ag386nsm; c : comp; dd : pdouble; begin - {$ifdef TP} +{$ifdef TP} c:=d; - {$else} +{$else TP} +{$ifdef Delphi} + c:=d; +{$else Delphi} c:=comp(d); - {$endif} +{$endif Delphi} +{$endif TP} dd:=pdouble(@c); { this makes a bitwise copy of c into a double } comp2str:=double2str(dd^); end; @@ -733,7 +737,10 @@ ait_stab_function_name : ; end. { $Log$ - Revision 1.30 1999-05-02 22:41:50 peter + Revision 1.31 1999-05-04 21:44:32 florian + * changes to compile it with Delphi 4.0 + + Revision 1.30 1999/05/02 22:41:50 peter * moved section names to systems * fixed nasm,intel writer diff --git a/compiler/assemble.pas b/compiler/assemble.pas index e0e0335b39..bf7344592f 100644 --- a/compiler/assemble.pas +++ b/compiler/assemble.pas @@ -29,6 +29,9 @@ interface {$endif} uses +{$ifdef Delphi} + dmisc, +{$endif Delphi} dos,cobjects,globtype,globals,aasm; const @@ -545,7 +548,10 @@ end; end. { $Log$ - Revision 1.44 1999-05-02 23:28:42 peter + Revision 1.45 1999-05-04 21:44:33 florian + * changes to compile it with Delphi 4.0 + + Revision 1.44 1999/05/02 23:28:42 peter * don't include ag386bin for oldasm Revision 1.43 1999/05/02 22:41:51 peter diff --git a/compiler/cg386set.pas b/compiler/cg386set.pas index 89d28eb820..4d7351a247 100644 --- a/compiler/cg386set.pas +++ b/compiler/cg386set.pas @@ -659,8 +659,11 @@ implementation var lv,hv,min_label,max_label,labels : longint; max_linear_list : longint; +{$ifdef Delphi} + dist : longword; +{$else Delphi} dist : dword; - +{$endif Delphi} begin getlabel(endlabel); getlabel(elselabel); @@ -741,10 +744,17 @@ implementation if (min_label<0) and (max_label>0) then begin +{$ifdef Delphi} + if min_label=$80000000 then + dist:=longword(max_label)+longword($80000000) + else + dist:=longword(max_label)+longword(-min_label) +{$else Delphi} if min_label=$80000000 then dist:=dword(max_label)+dword($80000000) else dist:=dword(max_label)+dword(-min_label) +{$endif Delphi} end else dist:=max_label-min_label; @@ -824,7 +834,10 @@ implementation end. { $Log$ - Revision 1.28 1999-05-01 13:24:15 peter + Revision 1.29 1999-05-04 21:44:34 florian + * changes to compile it with Delphi 4.0 + + Revision 1.28 1999/05/01 13:24:15 peter * merged nasm compiler * old asm moved to oldasm/ diff --git a/compiler/comphook.pas b/compiler/comphook.pas index 3f92447ad2..f4cf553baf 100644 --- a/compiler/comphook.pas +++ b/compiler/comphook.pas @@ -154,13 +154,17 @@ begin { Status info?, Called every line } if ((status.verbosity and V_Status)<>0) then begin +{$ifndef Delphi} if (status.compiledlines=1) then WriteLn(memavail shr 10,' Kb Free'); +{$endif Delphi} if (status.currentline>0) and (status.currentline mod 100=0) then {$ifdef FPC} WriteLn(status.currentline,' ',memavail shr 10,'/',system.heapsize shr 10,' Kb Free'); {$else} +{$ifndef Delphi} WriteLn(status.currentline,' ',memavail shr 10,' Kb Free'); +{$endif Delphi} {$endif} end end; @@ -261,7 +265,10 @@ end; end. { $Log$ - Revision 1.15 1999-01-15 12:27:23 peter + Revision 1.16 1999-05-04 21:44:38 florian + * changes to compile it with Delphi 4.0 + + Revision 1.15 1999/01/15 12:27:23 peter * removed path from output, was there only for debugging Revision 1.14 1999/01/14 21:47:09 peter diff --git a/compiler/compiler.pas b/compiler/compiler.pas index 44b81bea2a..715e345f6b 100644 --- a/compiler/compiler.pas +++ b/compiler/compiler.pas @@ -92,6 +92,9 @@ uses {$ifdef BrowserCol} browcol, {$endif BrowserCol} +{$ifdef Delphi} + dmisc, +{$endif Delphi} dos,verbose,comphook,systems, globals,options,parser,symtable,link,import,export; @@ -266,7 +269,10 @@ end; end. { $Log$ - Revision 1.20 1999-04-21 09:43:33 peter + Revision 1.21 1999-05-04 21:44:39 florian + * changes to compile it with Delphi 4.0 + + Revision 1.20 1999/04/21 09:43:33 peter * storenumber works * fixed some typos in double_checksum + incompatible types type1 and type2 message (with storenumber) diff --git a/compiler/comprsrc.pas b/compiler/comprsrc.pas index aff6557bdf..0b233cee9d 100644 --- a/compiler/comprsrc.pas +++ b/compiler/comprsrc.pas @@ -30,6 +30,9 @@ procedure CompileResourceFiles; implementation uses +{$ifdef Delphi} + dmisc, +{$endif Delphi} Dos, Systems,Globtype,Globals,Verbose,Files, Script; @@ -53,7 +56,11 @@ var utilsdirectory,resfound); end else +{$ifdef Delphi} + respath:=Search(target_res.resbin+source_os.exeext,'.;'+exepath+';'+dmisc.getenv('PATH'),resfound); +{$else Delphi} respath:=Search(target_res.resbin+source_os.exeext,'.;'+exepath+';'+dos.getenv('PATH'),resfound); +{$endif Delphi} resbin:=respath+target_res.resbin+source_os.exeext; if (not resfound) and not(cs_link_extern in aktglobalswitches) then begin @@ -103,7 +110,10 @@ end; end. { $Log$ - Revision 1.3 1999-01-06 14:38:09 michael + Revision 1.4 1999-05-04 21:44:40 florian + * changes to compile it with Delphi 4.0 + + Revision 1.3 1999/01/06 14:38:09 michael + Fixed wrong unit name. Revision 1.2 1999/01/06 12:56:01 peter diff --git a/compiler/dmisc.pas b/compiler/dmisc.pas index 14783bd674..4c11f0bf71 100644 --- a/compiler/dmisc.pas +++ b/compiler/dmisc.pas @@ -328,7 +328,7 @@ var SI: TStartupInfo; PI: TProcessInformation; Proc : THandle; - l : Longint; + l : DWord; AppPath, AppParam : array[0..255] of char; begin @@ -351,7 +351,7 @@ begin if WaitForSingleObject(Proc, Infinite) <> $ffffffff then GetExitCodeProcess(Proc,l) else - l:=-1; + l:=$ffffffff; CloseHandle(Proc); LastDosExitCode:=l; end; @@ -395,7 +395,7 @@ function diskfree(drive : byte) : longint; var disk : array[1..4] of char; secs,bytes, - free,total : longint; + free,total : DWord; begin if drive=0 then begin @@ -420,7 +420,7 @@ function disksize(drive : byte) : longint; var disk : array[1..4] of char; secs,bytes, - free,total : longint; + free,total : DWord; begin if drive=0 then begin @@ -848,7 +848,10 @@ End; end. { $Log$ - Revision 1.1 1998-09-18 16:03:38 florian + Revision 1.2 1999-05-04 21:44:41 florian + * changes to compile it with Delphi 4.0 + + Revision 1.1 1998/09/18 16:03:38 florian * some changes to compile with Delphi } diff --git a/compiler/files.pas b/compiler/files.pas index 188cf2b443..4e9d6955aa 100644 --- a/compiler/files.pas +++ b/compiler/files.pas @@ -221,6 +221,9 @@ unit files; implementation uses +{$ifdef Delphi} + dmisc, +{$endif Delphi} dos,verbose,systems, symtable,scanner; @@ -1191,7 +1194,10 @@ uses end. { $Log$ - Revision 1.93 1999-04-26 13:31:29 peter + Revision 1.94 1999-05-04 21:44:42 florian + * changes to compile it with Delphi 4.0 + + Revision 1.93 1999/04/26 13:31:29 peter * release storenumber,double_checksum Revision 1.92 1999/04/25 15:08:36 peter diff --git a/compiler/globals.pas b/compiler/globals.pas index 08cb1f25bb..36e21cbc18 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -33,6 +33,10 @@ unit globals; {$ifdef TP} objects, {$endif} +{$ifdef Delphi4} + dmisc, + sysutils, +{$endif} {$ifdef linux} linux, {$endif} @@ -655,7 +659,11 @@ unit globals; var hour,min,sec,hsec : word; begin +{$ifdef delphi} + dmisc.gettime(hour,min,sec,hsec); +{$else delphi} dos.gettime(hour,min,sec,hsec); +{$endif delphi} gettimestr:=L0(Hour)+':'+L0(min)+':'+L0(sec); end; @@ -667,7 +675,11 @@ unit globals; var Year,Month,Day,Wday : Word; begin +{$ifdef delphi} + dmisc.getdate(year,month,day,wday); +{$else} dos.getdate(year,month,day,wday); +{$endif} getdatestr:=L0(Year)+'/'+L0(Month)+'/'+L0(Day); end; @@ -728,7 +740,14 @@ unit globals; Begin End; {$endif not FPC} +{$ifdef delphi} + Function FileExists ( Const F : String) : Boolean; + begin + FileExists:=sysutils.FileExists(f); + end; + +{$else} Function FileExists ( Const F : String) : Boolean; Var {$ifdef linux} @@ -745,6 +764,7 @@ unit globals; findclose(Info); {$endif} end; +{$endif} Function RemoveFile(const f:string):boolean; @@ -1014,7 +1034,11 @@ unit globals; if FStat (F,Info) then L:=info.mtime; {$else} +{$ifdef delphi} + dmisc.FindFirst (F,archive+readonly+hidden,info); +{$else delphi} FindFirst (F,archive+readonly+hidden,info); +{$endif delphi} if DosError=0 then l:=info.time; {$ifdef Linux} @@ -1057,7 +1081,11 @@ unit globals; function FindExe(bin:string;var found:boolean):string; begin bin:=FixFileName(bin)+source_os.exeext; +{$ifdef delphi} + FindExe:=Search(bin,'.;'+exepath+';'+dmisc.getenv('PATH'),found)+bin; +{$else delphi} FindExe:=Search(bin,'.;'+exepath+';'+dos.getenv('PATH'),found)+bin; +{$endif delphi} end; procedure abstract; @@ -1075,7 +1103,11 @@ unit globals; hs1 : namestr; hs2 : extstr; begin +{$ifdef delphi} + exepath:=dmisc.getenv('PPC_EXEC_PATH'); +{$else delphi} exepath:=dos.getenv('PPC_EXEC_PATH'); +{$endif delphi} if exepath='' then fsplit(FixFileName(paramstr(0)),exepath,hs1,hs2); {$ifdef linux} @@ -1159,7 +1191,10 @@ begin end. { $Log$ - Revision 1.4 1999-04-26 13:31:32 peter + Revision 1.5 1999-05-04 21:44:43 florian + * changes to compile it with Delphi 4.0 + + Revision 1.4 1999/04/26 13:31:32 peter * release storenumber,double_checksum Revision 1.3 1999/04/21 14:12:55 peter diff --git a/compiler/link.pas b/compiler/link.pas index 1a21e2a20f..757c9b81a0 100644 --- a/compiler/link.pas +++ b/compiler/link.pas @@ -65,6 +65,9 @@ Var Implementation uses +{$ifdef Delphi} + dmisc, +{$endif Delphi} globtype,systems, script,globals,verbose {$ifdef i386} @@ -637,7 +640,10 @@ end; end. { $Log$ - Revision 1.52 1999-05-03 21:30:30 peter + Revision 1.53 1999-05-04 21:44:44 florian + * changes to compile it with Delphi 4.0 + + Revision 1.52 1999/05/03 21:30:30 peter + glibc 2.1 Revision 1.51 1999/04/28 23:42:33 pierre diff --git a/compiler/mppc386.bat b/compiler/mppc386.bat index b0109ffd23..dc2cf50e36 100644 --- a/compiler/mppc386.bat +++ b/compiler/mppc386.bat @@ -1,4 +1,4 @@ -ppc386 -OG2p2 -Ch8000000 -dI386 -dGDB -dBROWSERLOG -a -Sg pp.pas %1 %2 %3 %4 %5 %6 %7 %8 %9 +ppc386 -Ch8000000 -dI386 -dGDB -dBROWSERLOG -a -Sg pp.pas %1 %2 %3 %4 %5 %6 %7 %8 %9 if errorlevel 0 goto success goto failed :success diff --git a/compiler/msgtxt.inc b/compiler/msgtxt.inc index f12fbe4796..56be3196e6 100644 --- a/compiler/msgtxt.inc +++ b/compiler/msgtxt.inc @@ -1,4 +1,8 @@ +{$ifdef Delphi} +const msgtxt : array[0..00103] of string[240]=( +{$else} const msgtxt : array[0..00103,1..240] of char=( +{$endif} 'T_Compiler: $1'#000+ 'D_Source OS: $1'#000+ 'I_Target OS: $1'#000+ @@ -537,7 +541,7 @@ const msgtxt : array[0..00103,1..240] of char=( 'Compiler Date : $FPCDATE'#000+ 'Compiler Target: $FPCTARGET'#000+ #000+ - 'This program comes under the GNU General Public Licence'#000,+ + 'This program comes under the GNU General Public Licence'#000, 'For more information read COPYING.FPC'#000+ #000+ 'Report bugs,suggestions etc to:'#000+ diff --git a/compiler/og386.pas b/compiler/og386.pas index 535fe5b249..ab5f7fac56 100644 --- a/compiler/og386.pas +++ b/compiler/og386.pas @@ -28,6 +28,9 @@ unit og386; interface uses +{$ifdef Delphi} + dmisc, +{$endif Delphi} dos, owbase,owar, systems,i386base,aasm; @@ -236,7 +239,10 @@ unit og386; end. { $Log$ - Revision 1.2 1999-05-02 22:41:54 peter + Revision 1.3 1999-05-04 21:44:50 florian + * changes to compile it with Delphi 4.0 + + Revision 1.2 1999/05/02 22:41:54 peter * moved section names to systems * fixed nasm,intel writer diff --git a/compiler/os2_targ.pas b/compiler/os2_targ.pas index f98beedb6b..0d6eadba2b 100644 --- a/compiler/os2_targ.pas +++ b/compiler/os2_targ.pas @@ -47,7 +47,11 @@ type implementation -uses globtype,dos,strings,globals,link,files; + uses +{$ifdef Delphi} + dmisc, +{$endif Delphi} + globtype,dos,strings,globals,link,files; const profile_flag:boolean=false; @@ -329,7 +333,10 @@ end. { $Log$ - Revision 1.6 1998-12-11 00:03:25 peter + Revision 1.7 1999-05-04 21:44:52 florian + * changes to compile it with Delphi 4.0 + + Revision 1.6 1998/12/11 00:03:25 peter + globtype,tokens,version unit splitted from globals Revision 1.5 1998/10/16 14:20:53 daniel diff --git a/compiler/owar.pas b/compiler/owar.pas index e60b775317..2c3d8bcf1f 100644 --- a/compiler/owar.pas +++ b/compiler/owar.pas @@ -64,7 +64,10 @@ type implementation uses - dos; +{$ifdef Delphi} + dmisc, +{$endif Delphi} + dos; const {$ifdef TP} @@ -273,7 +276,10 @@ end; end. { $Log$ - Revision 1.1 1999-05-01 13:24:26 peter + Revision 1.2 1999-05-04 21:44:53 florian + * changes to compile it with Delphi 4.0 + + Revision 1.1 1999/05/01 13:24:26 peter * merged nasm compiler * old asm moved to oldasm/ diff --git a/compiler/pdecl.pas b/compiler/pdecl.pas index c21d386b81..2733c36af1 100644 --- a/compiler/pdecl.pas +++ b/compiler/pdecl.pas @@ -261,7 +261,7 @@ unit pdecl; { to handle absolute } abssym : pabsolutesym; l : longint; - code : word; + code : integer; { c var } newtype : ptypesym; is_dll, @@ -792,7 +792,7 @@ unit pdecl; p,p2 : ppropertysym; overriden : psym; hs : string; - code : word; + code : integer; varspez : tvarspez; sc : pstringcontainer; hp : pdef; @@ -2272,7 +2272,10 @@ unit pdecl; end. { $Log$ - Revision 1.113 1999-05-01 13:24:30 peter + Revision 1.114 1999-05-04 21:44:54 florian + * changes to compile it with Delphi 4.0 + + Revision 1.113 1999/05/01 13:24:30 peter * merged nasm compiler * old asm moved to oldasm/ diff --git a/compiler/pexports.pas b/compiler/pexports.pas index ca01752aa6..ec64af9077 100644 --- a/compiler/pexports.pas +++ b/compiler/pexports.pas @@ -39,7 +39,7 @@ unit pexports; var hp : pexported_item; - code : word; + code : integer; DefString:string; ProcName:string; InternalProcName:string; @@ -120,7 +120,10 @@ end. { $Log$ - Revision 1.8 1999-03-26 00:05:35 peter + Revision 1.9 1999-05-04 21:44:56 florian + * changes to compile it with Delphi 4.0 + + Revision 1.8 1999/03/26 00:05:35 peter * released valintern + deffile is now removed when compiling is finished * ^( compiles now correct diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas index 9ed6b87cf7..be455408d2 100644 --- a/compiler/pexpr.pas +++ b/compiler/pexpr.pas @@ -534,6 +534,31 @@ unit pexpr; afterassignment:=prevafterassn; end; + procedure handle_procvar(procvar : pprocvardef;var t : ptree); + + begin + if ((procvar^.options and pomethodpointer)<>0) then + begin + if (t^.methodpointer^.resulttype^.deftype=objectdef) and + (pobjectdef(t^.methodpointer^.resulttype)^.isclass) and + (proc_to_procvar_equal(procvar,pprocsym(t^.symtableentry)^.definition)) then + begin + t^.treetype:=loadn; + t^.disposetyp:=dt_left; + t^.left:=t^.methodpointer; + t^.resulttype:=pprocsym(t^.symtableprocentry)^.definition; + t^.symtableentry:=pvarsym(t^.symtableprocentry); + end + else + Message(type_e_mismatch); + end + else if (proc_to_procvar_equal(getprocvardef,pprocsym(t^.symtableentry)^.definition)) then + begin + t^.treetype:=loadn; + t^.resulttype:=pprocsym(t^.symtableprocentry)^.definition; + t^.symtableentry:=t^.symtableprocentry; + end; + end; { the following procedure handles the access to a property symbol } procedure handle_propertysym(sym : psym;st : psymtable;var p1 : ptree; @@ -578,8 +603,12 @@ unit pexpr; p1^.left:=paras; consume(ASSIGNMENT); { read the expression } + getprocvar:=ppropertysym(sym)^.proptype^.deftype=procvardef; p2:=comp_expr(true); + if (p2^.treetype<>errorn) and getprocvar then + handle_procvar(pprocvardef(ppropertysym(sym)^.proptype),p2); p1^.left:=gencallparanode(p2,p1^.left); + getprocvar:=false; end else if ppropertysym(sym)^.writeaccesssym^.typ=varsym then begin @@ -928,7 +957,7 @@ unit pexpr; else { not LKLAMMER} if (token=POINT) and (pd^.deftype=objectdef) and - ((pobjectdef(pd)^.options and oo_is_class)=0) then + not(pobjectdef(pd)^.isclass) then begin consume(POINT); if assigned(procinfo._class) then @@ -983,7 +1012,7 @@ unit pexpr; begin { class reference ? } if (pd^.deftype=objectdef) - and ((pobjectdef(pd)^.options and oo_is_class)<>0) then + and pobjectdef(pd)^.isclass then begin p1:=gentypenode(pd); p1^.resulttype:=pd; @@ -1056,7 +1085,7 @@ unit pexpr; again,p1,pd); if possible_error and ((p1^.procdefinition^.options and poclassmethod)=0) then - Message(parser_e_only_class_methods); + Message(parser_e_only_class_methods); end; propertysym : begin { access to property in a method } @@ -1869,29 +1898,7 @@ unit pexpr; end; p2:=sub_expr(opcompare,true); if getprocvar and (p2^.treetype=calln) then - begin - if ((getprocvardef^.options and pomethodpointer)<>0) then - begin - if (p2^.methodpointer^.resulttype^.deftype=objectdef) and - (pobjectdef(p2^.methodpointer^.resulttype)^.isclass) and - (proc_to_procvar_equal(getprocvardef,pprocsym(p2^.symtableentry)^.definition)) then - begin - p2^.treetype:=loadn; - p2^.disposetyp:=dt_left; - p2^.left:=p2^.methodpointer; - p2^.resulttype:=pprocsym(p2^.symtableprocentry)^.definition; - p2^.symtableentry:=pvarsym(p2^.symtableprocentry); - end - else - Message(type_e_mismatch); - end - else if (proc_to_procvar_equal(getprocvardef,pprocsym(p2^.symtableentry)^.definition)) then - begin - p2^.treetype:=loadn; - p2^.resulttype:=pprocsym(p2^.symtableprocentry)^.definition; - p2^.symtableentry:=p2^.symtableprocentry; - end; - end; + handle_procvar(getprocvardef,p2); getprocvar:=false; p1:=gennode(assignn,p1,p2); end; @@ -1972,7 +1979,10 @@ unit pexpr; end. { $Log$ - Revision 1.99 1999-05-01 13:24:31 peter + Revision 1.100 1999-05-04 21:44:57 florian + * changes to compile it with Delphi 4.0 + + Revision 1.99 1999/05/01 13:24:31 peter * merged nasm compiler * old asm moved to oldasm/ diff --git a/compiler/ppc.dpr b/compiler/ppc.dpr index 44c9877351..7bf6b7aa86 100644 --- a/compiler/ppc.dpr +++ b/compiler/ppc.dpr @@ -229,7 +229,9 @@ begin exitproc:=@myexit; {$ifndef VER0_99_5} {$ifndef TP} + {$ifndef Delphi} heapblocks:=true; + {$endif Delphi} {$endif} {$endif} {$ifdef UseOverlay} @@ -241,7 +243,10 @@ begin end. { $Log$ - Revision 1.1 1998-09-18 16:03:44 florian + Revision 1.2 1999-05-04 21:44:58 florian + * changes to compile it with Delphi 4.0 + + Revision 1.1 1998/09/18 16:03:44 florian * some changes to compile with Delphi Revision 1.28 1998/08/26 15:31:17 peter diff --git a/compiler/ppu.pas b/compiler/ppu.pas index d5e6619989..4a6a8e8509 100644 --- a/compiler/ppu.pas +++ b/compiler/ppu.pas @@ -360,7 +360,8 @@ end; function tppufile.GetPPUVersion:longint; var l : longint; - code : word; + code : integer; + begin Val(header.ver[1]+header.ver[2]+header.ver[3],l,code); if code=0 then @@ -396,7 +397,12 @@ end; function tppufile.open:boolean; var ofmode : byte; +{$ifdef delphi} + i : integer; +{$else delphi} i : word; +{$endif delphi} + begin open:=false; assign(f,fname); @@ -868,7 +874,10 @@ end; end. { $Log$ - Revision 1.30 1999-04-26 18:30:00 peter + Revision 1.31 1999-05-04 21:44:59 florian + * changes to compile it with Delphi 4.0 + + Revision 1.30 1999/04/26 18:30:00 peter * farpointerdef moved into pointerdef.is_far Revision 1.29 1999/04/26 13:31:41 peter diff --git a/compiler/ra386att.pas b/compiler/ra386att.pas index aaa903a541..cdf62fffbd 100644 --- a/compiler/ra386att.pas +++ b/compiler/ra386att.pas @@ -990,7 +990,7 @@ end; var expr: string; tempstr: string; r : bestreal; - code : word; + code : integer; negativ : boolean; errorflag: boolean; Begin @@ -2056,7 +2056,10 @@ begin end. { $Log$ - Revision 1.42 1999-05-02 14:25:07 peter + Revision 1.43 1999-05-04 21:45:01 florian + * changes to compile it with Delphi 4.0 + + Revision 1.42 1999/05/02 14:25:07 peter * only allow * when call/jmp is used Revision 1.41 1999/05/01 13:48:39 peter diff --git a/compiler/ra386int.pas b/compiler/ra386int.pas index cc66ebb0da..79dd551ae0 100644 --- a/compiler/ra386int.pas +++ b/compiler/ra386int.pas @@ -894,7 +894,7 @@ Procedure BuildBracketExpression(var Instr: TInstruction); var l : longint; hs : string; - code : word; + code : integer; hreg, oldbase : tregister; GotPlus,Negative : boolean; @@ -1724,7 +1724,10 @@ begin end. { $Log$ - Revision 1.31 1999-05-01 13:48:41 peter + Revision 1.32 1999-05-04 21:45:02 florian + * changes to compile it with Delphi 4.0 + + Revision 1.31 1999/05/01 13:48:41 peter * merged nasm compiler Revision 1.6 1999/04/26 23:26:18 peter diff --git a/compiler/scanner.pas b/compiler/scanner.pas index e704b80056..bdc0828735 100644 --- a/compiler/scanner.pas +++ b/compiler/scanner.pas @@ -28,6 +28,9 @@ unit scanner; interface uses +{$ifdef Delphi} + dmisc, +{$endif Delphi} globtype,version,tokens, cobjects,globals,verbose,comphook,files; @@ -1651,7 +1654,10 @@ begin end. { $Log$ - Revision 1.81 1999-04-07 14:36:44 pierre + Revision 1.82 1999-05-04 21:45:04 florian + * changes to compile it with Delphi 4.0 + + Revision 1.81 1999/04/07 14:36:44 pierre + better preproc stack checking and report Revision 1.80 1999/04/06 11:20:59 peter diff --git a/compiler/symppu.inc b/compiler/symppu.inc index 8f5b7caf87..a3cec0a263 100644 --- a/compiler/symppu.inc +++ b/compiler/symppu.inc @@ -106,7 +106,7 @@ procedure writedefref(p : pdef); begin if p=nil then - current_ppu^.putlongint($ffffffff) + current_ppu^.putlongint(-1) else begin if p^.owner^.symtabletype=staticsymtable then @@ -129,7 +129,7 @@ procedure writesymref(p : psym); begin if p=nil then - current_ppu^.putlongint($ffffffff) + current_ppu^.putlongint(-1) else begin if p^.owner^.symtabletype=staticsymtable then @@ -510,7 +510,10 @@ { $Log$ - Revision 1.38 1999-04-26 13:31:51 peter + Revision 1.39 1999-05-04 21:45:06 florian + * changes to compile it with Delphi 4.0 + + Revision 1.38 1999/04/26 13:31:51 peter * release storenumber,double_checksum Revision 1.37 1999/04/21 09:43:53 peter diff --git a/compiler/symsym.inc b/compiler/symsym.inc index 6e36b59183..fa722fb49d 100644 --- a/compiler/symsym.inc +++ b/compiler/symsym.inc @@ -1273,9 +1273,11 @@ ((properties and sp_static)<>0) then begin if (cs_gdb_gsym in aktglobalswitches) then st := 'G' else st := 'S'; +{$ifndef Delphi} stabstring := strpnew('"'+owner^.name^+'__'+name+':'+ +definition^.numberstring+'",'+ tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname); +{$endif} end else if (owner^.symtabletype = globalsymtable) or (owner^.symtabletype = unitsymtable) then @@ -1972,7 +1974,10 @@ { $Log$ - Revision 1.84 1999-05-04 16:05:13 pierre + Revision 1.85 1999-05-04 21:45:07 florian + * changes to compile it with Delphi 4.0 + + Revision 1.84 1999/05/04 16:05:13 pierre * fix for unitsym problem Revision 1.83 1999/04/28 06:02:13 florian diff --git a/compiler/tpexcept.pas b/compiler/tpexcept.pas index 81ee120b6f..32124f1efa 100644 --- a/compiler/tpexcept.pas +++ b/compiler/tpexcept.pas @@ -190,6 +190,20 @@ implementation end; {$else} +{$ifdef Delphi} + + function setjmp(var rec : jmp_buf) : longint; + + begin + result:=0; + end; + + procedure longjmp(const rec : jmp_buf;return_value : longint); + + begin + end; + +{$else Delphi} function setjmp(var rec : jmp_buf) : longint; begin @@ -330,13 +344,16 @@ implementation ret end; end; - +{$endif Delphi} {$endif TP} end. { $Log$ - Revision 1.5 1998-10-28 18:26:23 pierre + Revision 1.6 1999-05-04 21:45:08 florian + * changes to compile it with Delphi 4.0 + + Revision 1.5 1998/10/28 18:26:23 pierre * removed some erros after other errors (introduced by useexcept) * stabs works again correctly (for how long !) diff --git a/compiler/verbose.pas b/compiler/verbose.pas index c4deeb4405..a0c48e08e4 100644 --- a/compiler/verbose.pas +++ b/compiler/verbose.pas @@ -123,7 +123,7 @@ end; function SetVerbosity(const s:string):boolean; var m : Longint; - i : Word; + i : Integer; inverse : boolean; c : char; begin @@ -133,11 +133,12 @@ begin status.verbosity:=m else begin - for i:=1 to length(s) do + i:=1; + while i<=length(s) do begin c:=upcase(s[i]); inverse:=false; - { on/off ? } + { on/off ? } if (i