It should be possible to use
clock_gettimewhen it’s available and fall back to some other clock when it’s not. If you look in the 10.12 SDK, you’ll see that this routine is decorated with the
__CLOCK_AVAILABILITYmacro, which expands to various platform availability macros including
__OSX_AVAILABLE(10.12). Thus, if you set your deployment target you’ll link to this call weakly.
For that to work the calling code has to:
check for the presence of the routine
use it if it’s present
implement a fallback if it’s not
You’ll find more details on how to do this is the SDK Compatibility Guide.
You haven’t posted any details as to how your code deals with this aspect of the problem, so it’s hard to say what’s going wrong here.
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
Thanks for the link to the SDK guide, thats what I was hoping for. My own code actually never calls clock_gettime, so I guess the problem lies within boost. I just checked, both my build and my build of boost use the deployment target, so I guess boost gets it wrong, I'll dig into that direction.
Solved for me, thanks again,