Skip to content

Commit 2d97488

Browse files
[[ YosemiteUpdate ]] Appropriately get the system version from Mac (which was wrong on Yosemite)
1 parent 73d2e7e commit 2d97488

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

engine/src/dskmac.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4470,9 +4470,23 @@ struct MCMacDesktop: public MCSystemInterface, public MCMacSystemService
44704470

44714471
MCinfinity = HUGE_VAL;
44724472

4473-
long response;
4474-
if (Gestalt(gestaltSystemVersion, &response) == noErr)
4475-
MCmajorosversion = response;
4473+
// SN-2014-10-08: [[ YosemiteUpdate ]] gestaltSystemVersion stops to 9 after any Minor/Bugfix >= 10
4474+
// We want to keep the same way the os version is built, which is 0xMMmb
4475+
// - MM reads the decimal major version number
4476+
// - m reads the hexadecimal minor version number
4477+
// - b reads the hexadecimal bugfix number.
4478+
long t_major, t_minor, t_bugfix;
4479+
if (Gestalt(gestaltSystemVersionMajor, &t_major) == noErr &&
4480+
Gestalt(gestaltSystemVersionMinor, &t_minor) == noErr &&
4481+
Gestalt(gestaltSystemVersionBugFix, &t_bugfix) == noErr)
4482+
{
4483+
if (t_major < 10)
4484+
MCmajorosversion = t_major * 0x100;
4485+
else
4486+
MCmajorosversion = (t_major / 10) * 0x1000 + (t_major - 10) * 0x100;
4487+
MCmajorosversion += t_minor * 0x10;
4488+
MCmajorosversion += t_bugfix * 0x1;
4489+
}
44764490

44774491
MCaqua = True; // Move to MCScreenDC
44784492

@@ -4498,6 +4512,7 @@ struct MCMacDesktop: public MCSystemInterface, public MCMacSystemService
44984512
MCS_reset_time();
44994513
// END HERE
45004514

4515+
long response;
45014516
if (Gestalt('ICAp', &response) == noErr)
45024517
{
45034518
OSErr err;

0 commit comments

Comments
 (0)