Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-08

$(TargetOS) and {$I %FPCTARGETOS%} result NOT equal on linux

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

FreeMan

last lazarus & fpc svn
Kubuntu 14.04 x64
In project option,
Target file name (-0): apps/Myproject_$(TargetOS) result is "*Myproject_linux*"
In code:
...
S := Format('%s_%s.zip', ['*Myproject_*', {$I %FPCTARGETOS%}]); result is "*Myproject_Linux*"

os linux is case sensitive, so first char "L" is different and lazarus macro and fpc variable

/opt/lazarus/components/codetools/definetemplates.pas 2780:8

function GetCompiledTargetOS: string;
begin
   Result:=Result:=lowerCase({$I %FPCTARGETOS%});
end;

why lazarus change to lowerCase fpc constant ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140811/3acb9fda/attachment.html>

Reply by email

Mattias Gaertner
to FreeMan
Show quoted text 9 lines
[...] Target file name (-0): apps/Myproject_$(TargetOS) result is "*Myproject_linux*" In code: ... S := Format('%s_%s.zip', ['*Myproject_*', {$I %FPCTARGETOS%}]); result is "*Myproject_Linux*" [...] why lazarus change to lowerCase fpc constant ?

The TargetOS macro is used for file paths. To avoid case sensitivity problems the macro is always lowercase.

Mattias

Reply by email