detecting OS version at run-time vs compile-time lazarus / 34-Windows ---------------------------------------------------------------------- beefycoder · 2011-01-17 23:12 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. ---------------------------------------------------------------------- typo · 2011-01-18 00:07 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. ---------------------------------------------------------------------- marcov · 2011-01-18 08:41 And for *nix* you might want to look at baseunix.fpuname.