Recent

Author Topic: Determine MacOS X version on runtime  (Read 1134 times)

Xor-el

  • Sr. Member
  • ****
  • Posts: 404
Determine MacOS X version on runtime
« on: June 10, 2019, 02:27:39 am »
Hi all,
I have a code am working on that requires a certain API that is unfortunately available only on MacOS X 10.7 and above.
While I want to support Mac versions lower than that specified above, I cannot do that because I don't know how to determine the MacOS X version number at runtime.
Does anyone have a code that can help (preferably one not deprecated and not requiring me to import the LCL (that is, will work on Console programs too))?
Something like

Code: [Select]
If MacOSXVersion >= 10.7 do
begin

end

else

begin

end.

Thanks In advance.
« Last Edit: June 10, 2019, 03:03:48 am by Xor-el »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Determine MacOS X version on runtime
« Reply #1 on: June 10, 2019, 03:28:57 am »
http://wiki.freepascal.org/Cocoa_Internals/OS_Versions#AppKit_Version

I'd certainty recommend to just use the newer API.

Xor-el

  • Sr. Member
  • ****
  • Posts: 404
Re: Determine MacOS X version on runtime
« Reply #2 on: June 10, 2019, 07:57:16 am »
http://wiki.freepascal.org/Cocoa_Internals/OS_Versions#AppKit_Version

I'd certainty recommend to just use the newer API.

Thanks for replying, I guess I will just stick with the newer API since this will make the job far easier and also latest FireMonkey on Delphi do not support MacOS X versions below 10.7.

Thanks.

 

TinyPortal © 2005-2018