[fpc-pascal] Which OS?

Andres K. Foerster list at AKFoerster.de
Mon Jul 11 19:57:12 CEST 2005


Am Monday, dem 11. Jul 2005 schrieb Michael Van Canneyt:

> >Hello,
> >
> >how can I test - at runtime - under which OS (Linux, Windows and so on) a 
> >FPC-program is running?
> 
> Try
> 
> Var
>   ThisOS : String;
> 
> begin
>   ThisOS := {$I %FPCTARGET%};
> 
> results in a string of the form i386-linux or i386-win32.

But it is also just the platform the program is compiled for.
It doesn't work when you run with an ABI for a different system, 
ie. you run a FreeBSD binary on NetBSD.

-- 
AKFoerster




More information about the fpc-pascal mailing list