Uploaded image for project: 'Swift'
  1. Swift
  2. SR-576

kIOReturn* error codes are not imported to Swift

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: Standard Library
    • Labels:
    • Environment:

      Xcode 7.2 GM / Swift 2.1

      Description

      IOKit's kIOReturn* error codes (declared in iokit/IOKit/IOReturn.h) are not imported to Swift, presumably because they're defined in terms of a macro. For example:

      #define	iokit_common_err(return)          (sys_iokit|sub_iokit_common|return)
      ...
      #define kIOReturnNoMemory        iokit_common_err(0x2bd) // can't allocate memory
      

      The Objective-C IOBluetooth API uses these error codes, so they're useful even outside of IOKit development. Perhaps they could be re-defined in Swift, much like Mach Error.

        Attachments

          Activity

            People

            Assignee:
            jrose Jordan Rose
            Reporter:
            mattrajca Matt Rajca
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: