[MacPorts] #55649: tk @8.6.8: error: use of undeclared identifier 'NSOperatingSystemVersion'

MacPorts noreply at macports.org
Sun Jan 7 01:28:01 UTC 2018


#55649: tk @8.6.8: error: use of undeclared identifier 'NSOperatingSystemVersion'
---------------------+------------------------------------
  Reporter:  tehcog  |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:  2.4.2
Resolution:          |   Keywords:  mavericks mountainlion
      Port:  tk      |
---------------------+------------------------------------
Changes (by ryandesign):

 * keywords:  mavericks mountainlion lion snowleopard leopard tiger =>
     mavericks mountainlion


Comment:

 Maybe specific to the +quartz variant?

 The tk code actually says:

 {{{
 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1080
         Gestalt(gestaltSystemVersionMajor, (SInt32*)&major);
         Gestalt(gestaltSystemVersionMinor, (SInt32*)&minor);
         Gestalt(gestaltSystemVersionBugFix, (SInt32*)&patch);
 #else
         NSOperatingSystemVersion systemVersion = [[NSProcessInfo
 processInfo] operatingSystemVersion];
         major = systemVersion.majorVersion;
         minor = systemVersion.minorVersion;
         patch = systemVersion.patchVersion;
 #endif
 }}}

 Looks like this code was
 [https://github.com/tcltk/tk/commit/f56728f92c68f0ebbc445ee1e3daeda392780922
 #diff-fd5cbb565c67a2dc96a2c3e79cc88a08R187 originally added] checking `#if
 MAC_OS_X_VERSION_MIN_REQUIRED < 1080`, which was wrong since according to
 the Apple developer link from Marius above `NSOperatingSystemVersion` was
 introduced in 10.10.

 Then it was
 [https://github.com/tcltk/tk/commit/6aad9c9b454d5334c3e36cd2bf623dae8369defe
 #diff-fd5cbb565c67a2dc96a2c3e79cc88a08L187 changed] to check `#if
 MAC_OS_X_VERSION_MIN_REQUIRED < 10100` which was wrong since the correct
 value for OS X 10.10 according to /usr/include/AvailabilityMacros.h is
 `101000` not `10100`.

 Then it was
 [https://github.com/tcltk/tk/commit/4d6578ec8d04f7ef2b43b35aca0b23dae260c886
 #diff-fd5cbb565c67a2dc96a2c3e79cc88a08L178 changed back] to `#if
 MAC_OS_X_VERSION_MIN_REQUIRED < 1080`.

 So that means the condition should be changed to `#if
 MAC_OS_X_VERSION_MIN_REQUIRED < 101000`.

 It also means it currently only affects Mavericks and Mountain Lion, not
 older or newer.

--
Ticket URL: <https://trac.macports.org/ticket/55649#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list