[fpc-pascal] How to get string with target OS and CPU?

Krzysztof dibo20 at wp.pl
Fri May 27 14:38:52 CEST 2011


Thanks! Exactly what I needed. Is exists similar trick for get widgetset
type (QT, GTK)?

2011/5/27 Mattias Gaertner <nc-gaertnma at netcologne.de>

> On Fri, 27 May 2011 13:18:11 +0200
> Krzysztof <dibo20 at wp.pl> wrote:
>
> > Hi,
> >
> > I need friendly name of OS and processor type at runtime. I need this for
> > "user-agent" header in http client. Some kind of "Linux x86_64
> Ubuntu/11.04"
> > ("Linux x86_64" should be enough). "GetEnvironmentVariable" function does
> > not return anything interesting. I can build this string using compiler
> > defines but there is a lot of targets CPU and OS and maybe free pascal
> have
> > some functions? How free pascal build string name of output executable
> when
> > I set $(TargetCPU) in lazarus project options?
>
> Lazarus $(TargetCPU) is lowerCase({$I %FPCTARGETCPU%})
>
> TargetOS is lowerCase({$I %FPCTARGETOS%})
>
>
> Mattias
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110527/78395075/attachment.html>


More information about the fpc-pascal mailing list