+ Removed all compatibility defines from compiler

git-svn-id: trunk@335 -
This commit is contained in:
michael 2005-06-09 21:14:22 +00:00
parent 1d9407f2f3
commit 7449f99d5f
10 changed files with 9 additions and 177 deletions

View File

@ -367,40 +367,26 @@ implementation
procedure tmemdebug.start;
{$ifdef HASGETHEAPSTATUS}
var
status : TFPCHeapStatus;
{$endif HASGETHEAPSTATUS}
begin
{$ifdef HASGETHEAPSTATUS}
status:=GetFPCHeapStatus;
startmem:=status.CurrHeapUsed;
{$else HASGETHEAPSTATUS}
startmem:=memavail;
{$endif HASGETHEAPSTATUS}
end;
procedure tmemdebug.stop;
{$ifdef HASGETHEAPSTATUS}
var
status : TFPCHeapStatus;
{$endif HASGETHEAPSTATUS}
begin
{$ifdef HASGETHEAPSTATUS}
if startmem<>0 then
begin
status:=GetFPCHeapStatus;
inc(TotalMem,startmem-status.CurrHeapUsed);
startmem:=0;
end;
{$else HASGETHEAPSTATUS}
if startmem<>0 then
begin
inc(TotalMem,memavail-startmem);
startmem:=0;
end;
{$endif HASGETHEAPSTATUS}
end;

View File

@ -389,28 +389,12 @@ implementation
begin
delete:=false;
{ indexword in 1.0.x and 1.9.4 is broken }
{$ifndef VER1_0}
{$ifndef VER1_9_4}
{$define USEINDEXWORD}
{$endif}
{$endif}
{$ifdef USEINDEXWORD}
i:=indexword(buf^,length,s);
if i<>-1 then
begin
deleteidx(i);
delete := true;
end;
{$else USEINDEXWORD}
for i:=1 to length do
if buf^[i-1]=s then
begin
deleteidx(i-1);
delete:=true;
break;
end;
{$endif USEINDEXWORD}
{$undef USEINDEXWORD}
end;

View File

@ -225,10 +225,8 @@ end;
****************************************************************************}
function def_status:boolean;
{$ifdef HASGETHEAPSTATUS}
var
hstatus : TFPCHeapStatus;
{$endif HASGETHEAPSTATUS}
begin
def_status:=false; { never stop }
{ Status info?, Called every line }
@ -239,12 +237,8 @@ begin
begin
if status.currentline>0 then
Write(status.currentline,' ');
{$ifdef HASGETHEAPSTATUS}
hstatus:=GetFPCHeapStatus;
WriteLn(DStr(hstatus.CurrHeapUsed shr 10),'/',DStr(hstatus.CurrHeapSize shr 10),' Kb Used');
{$else HASGETHEAPSTATUS}
WriteLn(DStr(memavail shr 10),'/',DStr(system.heapsize shr 10),' Kb Free');
{$endif HASGETHEAPSTATUS}
end;
end;
{$ifdef macos}

View File

@ -359,9 +359,7 @@ function Compile(const cmd:string):longint;
var
starttime : real;
{$ifdef SHOWUSEDMEM}
{$ifdef HASGETHEAPSTATUS}
hstatus : TFPCHeapStatus;
{$endif HASGETHEAPSTATUS}
{$endif SHOWUSEDMEM}
begin
try
@ -451,12 +449,8 @@ begin
end;
end;
{$ifdef SHOWUSEDMEM}
{$ifdef HASGETHEAPSTATUS}
hstatus:=GetFPCHeapStatus;
Writeln('Max Memory used/heapsize: ',DStr(hstatus.MaxHeapUsed shr 10),'/',DStr(hstatus.MaxHeapSize shr 10),' Kb');
{$else HASGETHEAPSTATUS}
Writeln('Memory used (heapsize): ',DStr(system.Heapsize shr 10),' Kb');
{$endif HASGETHEAPSTATUS}
{$endif SHOWUSEDMEM}
{ Set the return value if an error has occurred }

View File

@ -41,11 +41,6 @@ interface
var
internalerrorproc : procedure(i:longint);
{$ifndef HASGETFPCHEAPSTATUS}
type
TFPCHeapStatus = THeapStatus;
function GetFPCHeapStatus:TFPCHeapStatus;
{$endif HASGETFPCHEAPSTATUS}
{# Returns the minimal value between @var(a) and @var(b) }
function min(a,b : longint) : longint;{$ifdef USEINLINE}inline;{$endif}
@ -150,14 +145,6 @@ uses
;
{$ifndef HASGETFPCHEAPSTATUS}
function GetFPCHeapStatus:TFPCHeapStatus;
begin
GetHeapStatus(result);
end;
{$endif HASGETFPCHEAPSTATUS}
var
uppertbl,
lowertbl : array[char] of char;

View File

@ -11,32 +11,13 @@
{ This reduces the memory requirements a lot }
{$PACKENUM 1}
{$ifndef VER1_0}
{ We don't use exceptions, so turn off the implicit
exceptions in the constructors }
{$IMPLICITEXCEPTIONS OFF}
{ Inline small functions, but not when EXTDEBUG is used }
{$ifndef EXTDEBUG}
{$define USEINLINE}
{$endif EXTDEBUG}
{$else}
{ Optimizer is broken when compiling with optimizations using 1.0.x }
{$ifndef USEOPT}
{$define NOOPT}
{$endif}
{ 1.0.x generates broken code for sysutils }
{$ifndef FORCE_SYSUTILS}
{$undef USE_SYSUTILS}
{$endif}
{$endif VER1_0}
{$ifdef VER1_9_4}
{ 1.9.4 generates broken code for sysutils }
{$ifndef FORCE_SYSUTILS}
{$undef USE_SYSUTILS}
{$endif}
{$endif}
{ We don't use exceptions, so turn off the implicit
exceptions in the constructors }
{$IMPLICITEXCEPTIONS OFF}
{ Inline small functions, but not when EXTDEBUG is used }
{$ifndef EXTDEBUG}
{$define USEINLINE}
{$endif EXTDEBUG}
{$define USEEXCEPT}

View File

@ -1763,61 +1763,11 @@ begin
def_system_macro('VER'+version_nr+'_'+release_nr+'_'+patch_nr);
{ Temporary defines, until things settle down }
def_system_macro('HASWIDECHAR');
def_system_macro('HASWIDESTRING');
def_system_macro('HASOUT');
def_system_macro('HASGLOBALPROPERTY');
def_system_macro('FPC_HASPREFETCH');
def_system_macro('FPC_LINEEND_IN_TEXTREC');
def_system_macro('FPC_ALIGNSRTTI');
def_system_macro('FPC_HASNOFARPOINTER');
def_system_macro('FPC_HASUSERDATA32');
{$ifdef i386}
def_system_macro('HASINTF');
def_system_macro('HASVARIANT');
{$endif i386}
{$ifdef x86_64}
def_system_macro('HASINTF');
def_system_macro('HASVARIANT');
{$endif x86_64}
{$ifdef powerpc}
def_system_macro('HASINTF');
def_system_macro('HASVARIANT');
def_system_macro('FPC_MTFSB0_CORRECTED');
{$endif powerpc}
{$ifdef arm}
def_system_macro('HASINTF');
def_system_macro('HASVARIANT');
{$endif arm}
{$ifdef sparc}
def_system_macro('HASINTF');
def_system_macro('HASVARIANT');
{$endif sparc}
def_system_macro('INTERNSETLENGTH');
def_system_macro('INTERNLENGTH');
def_system_macro('INTERNCOPY');
def_system_macro('INT64FUNCRESOK');
def_system_macro('HAS_ADDR_STACK_ON_STACK');
def_system_macro('NOBOUNDCHECK');
def_system_macro('HASCOMPILERPROC');
def_system_macro('INTERNCONSTINTF');
def_system_macro('VALUEGETMEM');
def_system_macro('VALUEFREEMEM');
def_system_macro('HASCURRENCY');
def_system_macro('HASTHREADVAR');
def_system_macro('HAS_GENERICCONSTRUCTOR');
def_system_macro('NOCLASSHELPERS');
if pocall_default = pocall_register then
def_system_macro('REGCALL');
def_system_macro('DECRREFNOTNIL');
def_system_macro('HAS_INTERNAL_INTTYPES');
def_system_macro('STR_USES_VALINT');
def_system_macro('NOSAVEREGISTERS');
def_system_macro('SHORTSTRCOMPAREINREG');
def_system_macro('HASGETHEAPSTATUS');
def_system_macro('HASGETFPCHEAPSTATUS');
def_system_macro('HASFUNCTIONCOPYDYNARR');
def_system_macro('HASOVERLOADASSIGNBYUNIQUERESULT');
{ using a case is pretty useless here (FK) }
{ some stuff for TP compatibility }

View File

@ -116,16 +116,6 @@ implementation
end;
{$ifdef VER1_0}
function get_extra_info(p : pointer) : string;
begin
with pextra_info(p)^ do
begin
get_extra_info:=getfilename(fileindex)+'('+tostr(line)+','+tostr(col)+
') ';
end;
end;
{$else}
procedure show_extra_info(var t : text;p : pointer);
begin
with pextra_info(p)^ do
@ -133,7 +123,6 @@ implementation
writeln(t,getfilename(fileindex)+'('+tostr(line)+','+tostr(col)+') ');
end;
end;
{$endif}
const
@ -145,13 +134,9 @@ implementation
begin
keepreleased:=true;
SetHeapTraceOutput('heap.log');
{$ifdef VER1_0}
SetExtraInfoString(@get_extra_info);
{$else}
SetHeapExtraInfo(sizeof(textra_info),
@set_extra_info,
@show_extra_info);
{$endif}
end;
pp_heap_inited:=true;
end;

View File

@ -187,20 +187,9 @@ implementation
else if is_constrealnode(p) and
(torddef(t.def).typ=scurrency)
{ allow bootstrapping }
{$ifdef VER1_0}
{ I get IE 10 here. I guess it's no problem if a 1.0 bootstrapped
compiler doesn't display the error here.
and (trealconstnode(p).value_real*10000 >= real(low(int64))) and
(trealconstnode(p).value_real*10000 <= real(high(int64)))}
{$endif VER1_0}
then
begin
{$ifdef VER1_0}
{ only trunc is 64 bit in 1.0.x so use trunc here to allow bootstrapping }
intvalue:=trunc(trealconstnode(p).value_real*10000);
{$else VER1_0}
intvalue:=round(trealconstnode(p).value_real*10000);
{$endif VER1_0}
end
else
begin
@ -237,18 +226,11 @@ implementation
s80real :
curconstSegment.concat(Tai_real_80bit.Create(value));
{$ifdef ver1_0}
s64comp :
curconstSegment.concat(Tai_comp_64bit.Create(value));
s64currency:
curconstSegment.concat(Tai_comp_64bit.Create(value*10000));
{$else ver1_0}
{ the round is necessary for native compilers where comp isn't a float }
s64comp :
curconstSegment.concat(Tai_comp_64bit.Create(round(value)));
s64currency:
curconstSegment.concat(Tai_comp_64bit.Create(round(value*10000)));
{$endif ver1_0}
s128real:
curconstSegment.concat(Tai_real_128bit.Create(value));
else

View File

@ -145,7 +145,6 @@ begin
end;
{$ifdef interncopy}
function fpc_char_copy(c:char;index : SizeInt;count : SizeInt): shortstring;compilerproc;
begin
if (index=1) and (Count>0) then
@ -153,16 +152,6 @@ begin
else
fpc_char_Copy:='';
end;
{$else}
function copy(c:char;index : SizeInt;count : SizeInt): shortstring;
begin
if (index=1) and (Count>0) then
Copy:=c
else
Copy:='';
end;
{$endif}
function pos(const substr : shortstring;c:char): SizeInt;
begin