Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-35888

qsystemdetection.h defines __MAC_OS_X_VERSION_MIN_REQUIRED when compiling for iPhoneOS -- breaks Apple-recommended OS detection

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.2.0
    • 5.2.0
    • QPA
    • None
    • Mac OS X 10.9, iOS 7 (simulator and device)
    • iOS/tvOS/watchOS

    Description

      qsystemdetection.h has a section for Q_OS_DARWIN, which covers both iOS and OS X. If it finds that __MAC_OS_X_VERSION_MIN_REQUIRED is undefined, qsystemdetection.h sets it to ___MAC_10_6. Qt shouldn't be setting this value – it's an Apple-defined value in Availability.h. It probably doesn't hurt anything on OS X, but when compiling for iOS, it breaks 3rd-party libraries that are expecting to do platform detection in the way Apple recommends. Apple recommends doing platform detection by checking whether or not __MAC_OS_X_VERSION_MIN_REQUIRED is defined. If it is defined, you know you're on OS X. If it is not defined, then you know you're on iOS. But! With Qt defining it, 3rd party libraries suddenly start trying to compile OS X-specific code agains the iOS SDK. Major fail!

      To fix, qsystemdetection.h should block out the __MAC_OS_X* logic so that it only gets applied when Q_OS_OSX is defined.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            branewave Paul Sturm
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes