amicommon: instead of a runtime check, check for OS2.0+ features at compile time in DOS

git-svn-id: trunk@44742 -
This commit is contained in:
Károly Balogh 2020-04-17 00:14:42 +00:00
parent 024ab0a854
commit db0deab026

View File

@ -1081,11 +1081,10 @@ Var
Res: Integer;
begin
SetLength(EnvList, 0);
{$if not defined(AMIGA_V1_0_ONLY) and not defined(AMIGA_V1_2_ONLY)}
// pr_LocalVars are introduced with OS2.0
{$ifdef AMIGA68k}
if PLibrary(AOS_ExecBase)^.lib_Version >= 36 then
{$endif}
begin
ThisProcess := PProcess(FindTask(nil)); //Get the pointer to our process
LocalVars_List := @(ThisProcess^.pr_LocalVars); //get the list of pr_LocalVars as pointer
LocalVar_Node := pLocalVar(LocalVars_List^.mlh_head); //get the headnode of the LocalVars list
@ -1114,7 +1113,8 @@ begin
end;
LocalVar_Node := pLocalVar(LocalVar_Node^.lv_node.ln_Succ); //we need to get the next node
end;
end;
{$endif not defined(AMIGA_V1_0_ONLY) and not defined(AMIGA_V1_2_ONLY)}
// search in env for all Variables
FillChar(Anchor,sizeof(TAnchorPath),#0);
Res := MatchFirst('ENV:#?', @Anchor);