Ok, added in conditional compilation to handle getting a context on OSX