* More ver1_0 defines removed

* Update compiler options

git-svn-id: trunk@3453 -
This commit is contained in:
daniel 2006-05-07 22:32:43 +00:00
parent 2cbd7fddcd
commit b87109913c
3 changed files with 32 additions and 37 deletions

View File

@ -254,7 +254,6 @@ begin
dup2:=false; dup2:=false;
end; end;
{$ifndef ver1_0}
function fpdup(fh:longint):longint; function fpdup(fh:longint):longint;
begin begin
if not dup(fh,fpdup) then if not dup(fh,fpdup) then
@ -268,33 +267,32 @@ begin
else else
fpdup2:=-1; fpdup2:=-1;
end; end;
{$endif ver1_0}
Function {$ifdef ver1_0}fdclose{$else}fpclose{$endif} (Handle : Longint) : boolean; function fpclose(Handle : Longint) : boolean;
var Regs: registers; var Regs: registers;
begin begin
Regs.Eax := $3e00; Regs.Eax := $3e00;
Regs.Ebx := Handle; Regs.Ebx := Handle;
MsDos(Regs); MsDos(Regs);
{$ifdef ver1_0}fdclose{$else}fpclose{$endif}:=(Regs.Flags and fCarry)=0; fpclose:=(Regs.Flags and fCarry)=0;
end; end;
{$endif def go32v2} {$endif def go32v2}
{$ifdef Windows} {$ifdef Windows}
Function {$ifdef ver1_0}fdclose{$else}fpclose{$endif} (Handle : Longint) : boolean; Function fpclose(Handle : Longint) : boolean;
begin begin
{ Do we need this ?? } { Do we need this ?? }
{$ifdef ver1_0}fdclose{$else}fpclose{$endif}:=true; fpclose:=true;
end; end;
{$endif} {$endif}
{$ifdef os2} {$ifdef os2}
Function {$ifdef ver1_0}fdclose{$else}fpclose{$endif} (Handle : Longint) : boolean; Function fpclose (Handle : Longint) : boolean;
begin begin
{ Do we need this ?? } { Do we need this ?? }
{$ifdef ver1_0}fdclose{$else}fpclose{$endif}:=true; fpclose:=true;
end; end;
{$endif} {$endif}
@ -302,9 +300,8 @@ end;
Function {$ifdef ver1_0}fdclose{$else}fpclose{$endif} (Handle : Longint) : boolean; Function {$ifdef ver1_0}fdclose{$else}fpclose{$endif} (Handle : Longint) : boolean;
begin begin
{ if executed as under GO32 this hangs the DOS-prompt } { if executed as under GO32 this hangs the DOS-prompt }
{$ifdef ver1_0}fdclose{$else}fpclose{$endif}:=true; fpclose:=true;
end; end;
{$endif} {$endif}
{$I-} {$I-}
@ -397,13 +394,8 @@ function ChangeRedirOut(Const Redir : String; AppendToFile : Boolean) : Boolean;
{$ifdef Windows} {$ifdef Windows}
if SetStdHandle(Std_Output_Handle,FileRec(FOUT^).Handle) then if SetStdHandle(Std_Output_Handle,FileRec(FOUT^).Handle) then
{$else not Windows} {$else not Windows}
{$ifdef ver1_0}
dup(StdOutputHandle,TempHOut);
dup2(FileRec(FOUT^).Handle,StdOutputHandle);
{$else}
TempHOut:=fpdup(StdOutputHandle); TempHOut:=fpdup(StdOutputHandle);
fpdup2(FileRec(FOUT^).Handle,StdOutputHandle); fpdup2(FileRec(FOUT^).Handle,StdOutputHandle);
{$endif}
if (TempHOut<>UnusedHandle) and if (TempHOut<>UnusedHandle) and
(StdOutputHandle<>UnusedHandle) then (StdOutputHandle<>UnusedHandle) then
{$endif not Windows} {$endif not Windows}
@ -435,13 +427,8 @@ function ChangeRedirIn(Const Redir : String) : Boolean;
{$ifdef Windows} {$ifdef Windows}
if SetStdHandle(Std_Input_Handle,FileRec(FIN^).Handle) then if SetStdHandle(Std_Input_Handle,FileRec(FIN^).Handle) then
{$else not Windows} {$else not Windows}
{$ifdef ver1_0}
dup(StdInputHandle,TempHIn);
dup2(FileRec(FIn^).Handle,StdInputHandle);
{$else}
TempHIn:=fpdup(StdInputHandle); TempHIn:=fpdup(StdInputHandle);
fpdup2(FileRec(FIn^).Handle,StdInputHandle); fpdup2(FileRec(FIn^).Handle,StdInputHandle);
{$endif}
if (TempHIn<>UnusedHandle) and if (TempHIn<>UnusedHandle) and
(StdInputHandle<>UnusedHandle) then (StdInputHandle<>UnusedHandle) then
{$endif not Windows} {$endif not Windows}
@ -477,13 +464,8 @@ function ChangeRedirError(Const Redir : String; AppendToFile : Boolean) : Boolea
{$ifdef Windows} {$ifdef Windows}
if SetStdHandle(Std_Error_Handle,FileRec(FERR^).Handle) then if SetStdHandle(Std_Error_Handle,FileRec(FERR^).Handle) then
{$else not Windows} {$else not Windows}
{$ifdef ver1_0}
dup(StdErrorHandle,TempHError);
dup2(FileRec(FERR^).Handle,StdErrorHandle);
{$else}
TempHError:=fpdup(StdErrorHandle); TempHError:=fpdup(StdErrorHandle);
fpdup2(FileRec(FERR^).Handle,StdErrorHandle); fpdup2(FileRec(FERR^).Handle,StdErrorHandle);
{$endif}
if (TempHError<>UnusedHandle) and if (TempHError<>UnusedHandle) and
(StdErrorHandle<>UnusedHandle) then (StdErrorHandle<>UnusedHandle) then
{$endif not Windows} {$endif not Windows}
@ -541,11 +523,11 @@ end;
{$ifdef Windows} {$ifdef Windows}
SetStdHandle(Std_Output_Handle,StdOutputHandle); SetStdHandle(Std_Output_Handle,StdOutputHandle);
{$else not Windows} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHOut,StdOutputHandle); fpdup2(TempHOut,StdOutputHandle);
{$endif not Windows} {$endif not Windows}
{$endif FPC} {$endif FPC}
Close (FOUT^); Close (FOUT^);
{$ifdef ver1_0}fdclose{$else}fpclose{$endif}(TempHOut); fpclose(TempHOut);
RedirChangedOut:=false; RedirChangedOut:=false;
end; end;
@ -562,11 +544,11 @@ end;
{$ifdef Windows} {$ifdef Windows}
SetStdHandle(Std_Input_Handle,StdInputHandle); SetStdHandle(Std_Input_Handle,StdInputHandle);
{$else not Windows} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHIn,StdInputHandle); fpdup2(TempHIn,StdInputHandle);
{$endif not Windows} {$endif not Windows}
{$endif} {$endif}
Close (FIn^); Close (FIn^);
{$ifdef ver1_0}fdclose{$else}fpclose{$endif}(TempHIn); fpclose(TempHIn);
RedirChangedIn:=false; RedirChangedIn:=false;
end; end;
@ -583,7 +565,7 @@ end;
{$ifdef Windows} {$ifdef Windows}
SetStdHandle(Std_Input_Handle,StdInputHandle); SetStdHandle(Std_Input_Handle,StdInputHandle);
{$else not Windows} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHIn,StdInputHandle); fpdup2(TempHIn,StdInputHandle);
{$endif not Windows} {$endif not Windows}
{$endif} {$endif}
InRedirDisabled:=True; InRedirDisabled:=True;
@ -603,7 +585,7 @@ end;
{$ifdef Windows} {$ifdef Windows}
SetStdHandle(Std_Input_Handle,FileRec(FIn^).Handle); SetStdHandle(Std_Input_Handle,FileRec(FIn^).Handle);
{$else not Windows} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(FileRec(FIn^).Handle,StdInputHandle); fpdup2(FileRec(FIn^).Handle,StdInputHandle);
{$endif not Windows} {$endif not Windows}
{$endif} {$endif}
InRedirDisabled:=False; InRedirDisabled:=False;
@ -622,7 +604,7 @@ end;
{$ifdef Windows} {$ifdef Windows}
SetStdHandle(Std_Output_Handle,StdOutputHandle); SetStdHandle(Std_Output_Handle,StdOutputHandle);
{$else not Windows} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHOut,StdOutputHandle); fpdup2(TempHOut,StdOutputHandle);
{$endif not Windows} {$endif not Windows}
{$endif} {$endif}
OutRedirDisabled:=True; OutRedirDisabled:=True;
@ -642,7 +624,7 @@ end;
{$ifdef Windows} {$ifdef Windows}
SetStdHandle(Std_Output_Handle,FileRec(FOut^).Handle); SetStdHandle(Std_Output_Handle,FileRec(FOut^).Handle);
{$else not Windows} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(FileRec(FOut^).Handle,StdOutputHandle); fpdup2(FileRec(FOut^).Handle,StdOutputHandle);
{$endif not Windows} {$endif not Windows}
{$endif} {$endif}
OutRedirDisabled:=False; OutRedirDisabled:=False;
@ -661,11 +643,11 @@ end;
{$ifdef Windows} {$ifdef Windows}
SetStdHandle(Std_Error_Handle,StdErrorHandle); SetStdHandle(Std_Error_Handle,StdErrorHandle);
{$else not Windows} {$else not Windows}
{$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHError,StdErrorHandle); fpdup2(TempHError,StdErrorHandle);
{$endif not Windows} {$endif not Windows}
{$endif} {$endif}
Close (FERR^); Close (FERR^);
{$ifdef ver1_0}fdclose{$else}fpclose{$endif}(TempHError); fpclose(TempHError);
RedirChangedError:=false; RedirChangedError:=false;
end; end;

View File

@ -783,6 +783,8 @@ const
opt_tp7compatibility = 'TP/BP ~7~.0 compatibility'; opt_tp7compatibility = 'TP/BP ~7~.0 compatibility';
opt_delphicompatibility = 'Del~p~hi compatibility'; opt_delphicompatibility = 'Del~p~hi compatibility';
opt_allowstaticinobjects = 'A~l~low STATIC in objects'; opt_allowstaticinobjects = 'A~l~low STATIC in objects';
opt_assertions = 'Include ~a~ssertion code';
opt_kylix = 'Load ~K~ylix compat. unit fpcylix';
opt_strictvarstrings = 'Strict ~v~ar-strings'; opt_strictvarstrings = 'Strict ~v~ar-strings';
opt_extendedsyntax = 'E~x~tended syntax'; opt_extendedsyntax = 'E~x~tended syntax';
opt_allowmmxoperations = 'Allow MMX op~e~rations'; opt_allowmmxoperations = 'Allow MMX op~e~rations';
@ -799,6 +801,9 @@ const
opt_stackchecking = '~S~tack checking'; opt_stackchecking = '~S~tack checking';
opt_iochecking = '~I~/O checking'; opt_iochecking = '~I~/O checking';
opt_overflowchecking = 'Integer ~o~verflow checking'; opt_overflowchecking = 'Integer ~o~verflow checking';
opt_objmethcallvalid = 'Object ~m~ethod call checking';
{ Code generation }
opt_pic = '~P~osition independend code';
{ Code options } { Code options }
opt_generatefastercode = 'Generate ~f~aster code'; opt_generatefastercode = 'Generate ~f~aster code';
opt_generatesmallercode = 'Generate s~m~aller code'; opt_generatesmallercode = 'Generate s~m~aller code';
@ -846,6 +851,7 @@ const
opt_exeppudirectories = '~E~XE output directory'; opt_exeppudirectories = '~E~XE output directory';
opt_ppuoutputdirectory = '~P~PU output directory'; opt_ppuoutputdirectory = '~P~PU output directory';
opt_cross_tools_directory = '~C~ross tools directory'; opt_cross_tools_directory = '~C~ross tools directory';
opt_dynamic_linker = '~D~ynamic linker path';
{ Library options } { Library options }
opt_librariesdefault = '~T~arget default'; opt_librariesdefault = '~T~arget default';
opt_dynamiclibraries = 'Link to ~D~ynamic libraries'; opt_dynamiclibraries = 'Link to ~D~ynamic libraries';

View File

@ -29,7 +29,8 @@ const
type type
TParamID = TParamID =
(idNone,idAlign,idRangeChecks,idStackChecks,idIOChecks, (idNone,idAlign,idRangeChecks,idStackChecks,idIOChecks,
idOverflowChecks,idAsmDirect,idAsmATT,idAsmIntel,idAsmMot, idOverflowChecks,idObjMethCallChecks,
idAsmDirect,idAsmATT,idAsmIntel,idAsmMot,
idSymInfNone,idSymInfGlobalOnly,idSymInfGlobalLocal, idSymInfNone,idSymInfGlobalOnly,idSymInfGlobalLocal,
idStackSize,idHeapSize,idStrictVarStrings,idExtendedSyntax, idStackSize,idHeapSize,idStrictVarStrings,idExtendedSyntax,
idMMXOps,idTypedAddress,idPackRecords,idPackEnum,idStackFrames, idMMXOps,idTypedAddress,idPackRecords,idPackEnum,idStackFrames,
@ -969,6 +970,8 @@ begin
AddBooleanItem(opt_tp7compatibility,'o',idNone); AddBooleanItem(opt_tp7compatibility,'o',idNone);
AddBooleanItem(opt_delphicompatibility,'d',idNone); AddBooleanItem(opt_delphicompatibility,'d',idNone);
AddBooleanItem(opt_allowstaticinobjects,'s',idNone); AddBooleanItem(opt_allowstaticinobjects,'s',idNone);
AddBooleanItem(opt_assertions,'a',idNone);
AddBooleanItem(opt_kylix,'k',idNone);
{ Useless as they are not passed to the compiler PM { Useless as they are not passed to the compiler PM
AddBooleanItem(opt_strictvarstrings,'/',idStrictVarStrings); AddBooleanItem(opt_strictvarstrings,'/',idStrictVarStrings);
AddBooleanItem(opt_extendedsyntax,'/',idExtendedSyntax); AddBooleanItem(opt_extendedsyntax,'/',idExtendedSyntax);
@ -992,6 +995,8 @@ begin
AddBooleanItem(opt_stackchecking,'t',idStackChecks); AddBooleanItem(opt_stackchecking,'t',idStackChecks);
AddBooleanItem(opt_iochecking,'i',idIOChecks); AddBooleanItem(opt_iochecking,'i',idIOChecks);
AddBooleanItem(opt_overflowchecking,'o',idOverflowChecks); AddBooleanItem(opt_overflowchecking,'o',idOverflowChecks);
AddBooleanItem(opt_objmethcallvalid,'R',idObjMethCallChecks);
{ AddBooleanItem(opt_pic,'g',idNone);}
end; end;
New(OptimizingGoalSwitches,InitSelect('O')); New(OptimizingGoalSwitches,InitSelect('O'));
with OptimizingGoalSwitches^ do with OptimizingGoalSwitches^ do
@ -1041,7 +1046,7 @@ begin
with AsmReaderSwitches^ do with AsmReaderSwitches^ do
begin begin
{$ifdef I386} {$ifdef I386}
AddSelectItem(opt_directassembler,'direct',idAsmDirect); { AddSelectItem(opt_directassembler,'direct',idAsmDirect);}
AddSelectItem(opt_attassembler,'att',idAsmATT); AddSelectItem(opt_attassembler,'att',idAsmATT);
AddSelectItem(opt_intelassembler,'intel',idAsmIntel); AddSelectItem(opt_intelassembler,'intel',idAsmIntel);
{$endif I386} {$endif I386}
@ -1099,6 +1104,7 @@ begin
AddStringItem(opt_exeppudirectories,'E',idNone,true,true); AddStringItem(opt_exeppudirectories,'E',idNone,true,true);
AddStringItem(opt_ppuoutputdirectory,'U',idNone,true,true); AddStringItem(opt_ppuoutputdirectory,'U',idNone,true,true);
AddStringItem(opt_cross_tools_directory,'D',idNone,true,true); AddStringItem(opt_cross_tools_directory,'D',idNone,true,true);
AddStringItem(opt_dynamic_linker,'L',idNone,false,false);
end; end;
New(LibLinkerSwitches,InitSelect('X')); New(LibLinkerSwitches,InitSelect('X'));
@ -1244,6 +1250,7 @@ begin
idStackChecks : AddSwitch('S'+P^.GetSwitchStr(SM)); idStackChecks : AddSwitch('S'+P^.GetSwitchStr(SM));
idIOChecks : AddSwitch('I'+P^.GetSwitchStr(SM)); idIOChecks : AddSwitch('I'+P^.GetSwitchStr(SM));
idOverflowChecks : AddSwitch('Q'+P^.GetSwitchStr(SM)); idOverflowChecks : AddSwitch('Q'+P^.GetSwitchStr(SM));
idObjMethCallChecks: AddSwitch('OBJECTCHECKS'+P^.GetSwitchStr(SM));
{ idAsmDirect : if P^.GetParamValueBool[SM] then AddParam('ASMMODE DIRECT'); { idAsmDirect : if P^.GetParamValueBool[SM] then AddParam('ASMMODE DIRECT');
idAsmATT : if P^.GetParamValueBool[SM] then AddParam('ASMMODE ATT'); idAsmATT : if P^.GetParamValueBool[SM] then AddParam('ASMMODE ATT');
idAsmIntel : if P^.GetParamValueBool[SM] then AddParam('ASMMODE INTEL'); idAsmIntel : if P^.GetParamValueBool[SM] then AddParam('ASMMODE INTEL');