Recent

Author Topic: detecting OS version at run-time vs compile-time  (Read 5851 times)

beefycoder

  • New Member
  • *
  • Posts: 24
detecting OS version at run-time vs compile-time
« 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.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: detecting OS version at run-time vs compile-time
« Reply #1 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.
« Last Edit: January 18, 2011, 01:09:26 am by typo »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8728
  • FPC developer.
Re: detecting OS version at run-time vs compile-time
« Reply #2 on: January 18, 2011, 09:41:21 am »
And for *nix* you might want to look at baseunix.fpuname.

 

TinyPortal © 2005-2018