Lazarus

Programming => Operating Systems => Windows => Topic started by: beefycoder on January 18, 2011, 12:12:57 am

Title: detecting OS version at run-time vs compile-time
Post by: beefycoder on January 18, 2011, 12:12:57 am
I am trying to translate some (to me complicated) source code written in C# and have found a line with

Code: [Select]
int p = (int)Environment.OSVersion.Platform;

To cut the long story short : what values does FPCTARGETOS return for following cases :

Code: [Select]
Windows 32bit
Windows 64bit
Linux 32bit
Linux 64bit

I only have access to Windows 32bit and FPCTARGETOS returned "Win32", i can only assume rest since i had to resort to some rather strange googling methods to find just some of the possible values FPCTARGETOS can return. Even now i'm not sure i got them all right.
Title: Re: detecting OS version at run-time vs compile-time
Post by: typo on January 18, 2011, 01:07:51 am
If knowing the target compilation OS is not enough for you, try GetVersionEx, http://msdn.microsoft.com/en-us/library/ms724451%28VS.85%29.aspx

For Windows, of course.
Title: Re: detecting OS version at run-time vs compile-time
Post by: marcov on January 18, 2011, 09:41:21 am
And for *nix* you might want to look at baseunix.fpuname.
TinyPortal © 2005-2018