[fpc-pascal] RE: Which OS?

Tomas Hajny XHajT03 at mbox.vol.cz
Tue Jul 12 16:48:03 CEST 2005

On Tue, July 12, 2005 13:07, Jeff Pohlmeyer said:
>> how can I test - at runtime - under which OS (Linux, Windows and so on)
>> a FPC-program is running?
>   {$IFDEF unix}
>      http://www.freepascal.org/docs-html/rtl/baseunix/fpuname.html
>   {$ELSE}
>     {IFDEF WIN32}
>       http://msdn.microsoft.com/library/en-us/sysinfo/base/getversionex.asp

      {$ELSE WIN32}
        {$IFDEF OS2}

 (or use Dos.DosVersion providing the same information)
           {$ELSE OS2}
             {$IFDEF GO32V2}
 int 21h/3000h & int 21h/3306h (not very reliable, but better than
nothing; the first one is provided in Dos.DosVersion)
             {$ELSE GO32V2}
               {$IFDEF NETWARE}
 Use Dos.DosVersion
               {$ENDIF NETWARE}
             {$ENDIF GO32V2}
        {$ENDIF OS2}

>     {$ENDIF}
>   {$ENDIF}

OK - I'm not sure if this is what the original author asked for, but this
is my extension for some more platforms.


More information about the fpc-pascal mailing list