Skip to content

Conversation

@mominul
Copy link

@mominul mominul commented Jan 5, 2017

Hi, this pull request fixes errors that are occurring when compiling in Linux

  • On Linux the callback function argument is UnsafeMutableRawPointer?
  • pthread_t is non optional on Linux

Thanks to @jakeheis for his fork

I haven't tested it on macOS

return nil
}
#else
func callback(x: UnsafeMutableRawPointer?) -> UnsafeMutableRawPointer? {
Copy link

@esttorhe esttorhe Nov 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that this repo is not mine or anything; but as seeing that the code inside the Linux path doesn't contain stuff that would fail compiling on macOS; wouldn't it be better to have something like macOSCallback and linuxCallback and then only applying the filtering inside of callback:

func callback(x: UnsafeMutableRawPointer?) -> UnsafeMutableRawPointer? {
#if(OSX)
   return macOSCallback(x)
#else
   return linuxCallback(x)
#endif
}

Edit: I think this would make it more readable; happy to discuss if this is not true or doesn't make sense or even if it really doesn't add any value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants