Prior to MacOS 11, the code below reported MacOS version correctly. It obviously will not work with MacOS 11, as the "10" is hard coded, but can anyone suggest the recommended backward compatible way to detect MacOS version.
Of reference, on MacOS 11.2.3, this program reports "MacOS: 10.16.3"
program ver;
{$mode objfpc}
uses Dos, sysutils;
//fpc ver.pas; ./ver
begin
writeln('MacOS: 10.' + IntToStr(Lo(DosVersion) - 4) + '.' + IntToStr(Hi(DosVersion)) );
end.