diff --git a/compiler/catch.pas b/compiler/catch.pas index bd78b3d633..a267c81d30 100644 --- a/compiler/catch.pas +++ b/compiler/catch.pas @@ -23,8 +23,10 @@ } Unit catch; -{ go32v2 stack check goes nuts if ss is not the data selector (PM) } -{$S-} +{$ifdef go32v2} + { go32v2 stack check goes nuts if ss is not the data selector (PM) } + {$S-} +{$endif} interface uses @@ -98,7 +100,10 @@ end. { $Log$ - Revision 1.8 1999-08-10 12:27:15 pierre + Revision 1.9 1999-08-25 16:41:04 peter + * resources are working again + + Revision 1.8 1999/08/10 12:27:15 pierre * not stack check inside catch !! Revision 1.7 1999/07/05 12:13:22 florian diff --git a/compiler/cg386ld.pas b/compiler/cg386ld.pas index d41dc3a3d0..3cc072d283 100644 --- a/compiler/cg386ld.pas +++ b/compiler/cg386ld.pas @@ -36,7 +36,7 @@ implementation uses globtype,systems, - cobjects,verbose,globals, + cobjects,verbose,globals,files, symconst,symtable,aasm,types, hcodegen,temp_gen,pass_2, cpubase,cpuasm, @@ -55,7 +55,7 @@ implementation s : pasmsymbol; popeax : boolean; pushed : tpushed; - hr,resref : treference; + hr : treference; begin simple_loadn:=true; @@ -81,10 +81,7 @@ implementation pushusedregisters(pushed,$ff); emit_const(A_PUSH,S_L, pconstsym(p^.symtableentry)^.resstrindex); - { Now we must push the address of the - resourcestringtable of the unit the resourcestring is in, - it has label modulename^+'_RESOURCESTRINGLIST' - MVC } + emit_sym(A_PUSH,S_L,newasmsymbol(current_module^.modulename^+'_RESOURCESTRINGLIST')); emitcall('FPC_GETRESOURCESTRING'); hregister:=getexplicitregister32(R_EAX); @@ -968,7 +965,10 @@ implementation end. { $Log$ - Revision 1.78 1999-08-25 11:59:43 jonas + Revision 1.79 1999-08-25 16:41:05 peter + * resources are working again + + Revision 1.78 1999/08/25 11:59:43 jonas * changed pai386, paippc and paiapha (same for tai*) to paicpu (taicpu) Revision 1.77 1999/08/24 22:38:51 michael diff --git a/compiler/cresstr.pas b/compiler/cresstr.pas index c0aa365a88..6f0ef58e76 100644 --- a/compiler/cresstr.pas +++ b/compiler/cresstr.pas @@ -53,11 +53,11 @@ const Var ResourceListRoot : PResourceString; ResourceListCurrent : PResourceString; - + { --------------------------------------------------------------------- - Calculate hash value, based on the string + Calculate hash value, based on the string ---------------------------------------------------------------------} - + function calc_resstring_hashvalue(P : Pchar; Len : longint) : longint; Var hash,g,I : longint; @@ -85,12 +85,8 @@ function calc_resstring_hashvalue(P : Pchar; Len : longint) : longint; { --------------------------------------------------------------------- Append 1 resourcestring to the linked list of resource strings. ---------------------------------------------------------------------} - -Function AppendToResourceList(const name : string;p : pchar;len,hash : longint) : longint; -Var R : PResourceString; - Index : longint; - +Function AppendToResourceList(const name : string;p : pchar;len,hash : longint) : longint; begin If ResourceListCurrent<>Nil then begin @@ -108,7 +104,7 @@ begin ResourceListCurrent^.Hash:=hash; GetMem(ResourceListCurrent^.Value,Len); Move(P^,ResourceListCurrent^.Value^,Len); - AppendToResourceList:=ResStrCount; + AppendToResourceList:=ResStrCount; inc(Resstrcount); end; @@ -118,7 +114,7 @@ end; Procedure AppendToAsmResList (P : PResourceString); -Var +Var l1 : pasmlabel; s : pchar; @@ -141,7 +137,7 @@ begin consts^.concat(new(pai_string,init_length_pchar(s,len))); consts^.concat(new(pai_const,init_8bit(0))); end; - { append Current value (nil) and hash...} + { append Current value (nil) and hash...} resourcestringlist^.concat(new(pai_const,init_32bit(0))); resourcestringlist^.concat(new(pai_const,init_32bit(hash))); { Append the name as a ansistring. } @@ -301,14 +297,17 @@ begin T:=R^.Next; Dispose(R); R:=T; - end; + end; ResStrCount:=0; end; end. { $Log$ - Revision 1.11 1999-08-23 11:48:23 michael + Revision 1.12 1999-08-25 16:41:07 peter + * resources are working again + + Revision 1.11 1999/08/23 11:48:23 michael * resourcestrings ams list needs unitname prepended Revision 1.10 1999/08/23 11:45:41 michael diff --git a/rtl/objpas/objpas.pp b/rtl/objpas/objpas.pp index 4a7aebe3a1..0988938e09 100644 --- a/rtl/objpas/objpas.pp +++ b/rtl/objpas/objpas.pp @@ -168,12 +168,12 @@ begin { --------------------------------------------------------------------- Delphi-Style memory management ---------------------------------------------------------------------} - + Type PLongint = ^Longint; Procedure Getmem(Var p:pointer;Size:Longint); - + begin Inc(Size,SizeOf(Longint)); SysGetmem(P,Size); @@ -185,7 +185,7 @@ begin begin FreeMem(P); end; - + Procedure Freemem(Var p:pointer;Size:Longint); begin @@ -197,7 +197,7 @@ begin begin If P<>Nil then begin - Dec(P,SizeOf(Longint)); + Dec(P,SizeOf(Longint)); SysFreemem(P,Plongint(P)^); end; end; @@ -206,7 +206,7 @@ begin Var OldMM,NEWMM : TmemoryManager; Procedure InitMemoryManager; - + begin GetMemoryManager(OldMM); NewMM.FreeMem:=@DummyFreeMem; @@ -218,7 +218,7 @@ Var OldMM,NEWMM : TmemoryManager; begin SetMemoryManager(OldMM); end; - + {$IFDEF HasResourceStrings} { --------------------------------------------------------------------- @@ -239,14 +239,14 @@ Type Resrec : Array[Word] of TResourceStringRecord; end; PResourceStringTable = ^TResourceStringTable; - + TResourceTableList = Packed Record Count : longint; Tables : Array[Word] of PResourceStringTable; end; - - + + Var ResourceStringTable : TResourceTablelist; External Name 'FPC_RESOURCESTRINGTABLES'; @@ -274,9 +274,8 @@ begin end; Function GetResourceString(Const TheTable: TResourceStringTable;Index : longint) : AnsiString;[Public,Alias : 'FPC_GETRESOURCESTRING']; - begin - If (Index>0) and (Index<TheTAble.Count) then + If (Index>=0) and (Index<TheTAble.Count) then Result:=TheTable.ResRec[Index].CurrentValue else Result:=''; @@ -300,8 +299,8 @@ Var I,J : longint; begin With ResourceStringTable do For I:=0 to Count-1 do - With Tables[I]^ do - For J:=0 to Count-1 do + With Tables[I]^ do + For J:=0 to Count-1 do With ResRec[J] do CurrentValue:=SetFunction(Name,DefaultValue,HashValue); end; @@ -314,8 +313,8 @@ Var I,J : longint; begin With ResourceStringTable do For I:=0 to Count-1 do - With Tables[I]^ do - For J:=0 to Count-1 do + With Tables[I]^ do + For J:=0 to Count-1 do With ResRec[J] do CurrentValue:=DefaultValue; end; @@ -333,7 +332,10 @@ end. { $Log$ - Revision 1.36 1999-08-24 22:42:56 michael + Revision 1.37 1999-08-25 16:41:08 peter + * resources are working again + + Revision 1.36 1999/08/24 22:42:56 michael * changed resourcestrings to new mechanism Revision 1.35 1999/08/24 12:02:29 michael