HighResolutionTimer::Pimpl not compiling


#1

I’m getting the following when trying to compile after the high resolution timer was introduced:

[exec] jni/../../../../juce/modules/juce_core/native/juce_posix_SharedCode.h: In static member function 'static void* juce::HighResolutionTimer::Pimpl::timerThread(void*)': [exec] jni/../../../../juce/modules/juce_core/native/juce_posix_SharedCode.h:1172:33: error: 'PTHREAD_CANCEL_ENABLE' was not declared in this scope [exec] jni/../../../../juce/modules/juce_core/native/juce_posix_SharedCode.h:1172:62: error: 'pthread_setcancelstate' was not declared in this scope [exec] jni/../../../../juce/modules/juce_core/native/juce_posix_SharedCode.h: In member function 'void juce::HighResolutionTimer::Pimpl::Clock::wait()': [exec] jni/../../../../juce/modules/juce_core/native/juce_posix_SharedCode.h:1228:73: error: 'clock_nanosleep' was not declared in this scope

After doing a little digging I found that the pthreads implementation in android actually doesn’t include the cancel functionality.

As for the clock_nanosleep, I can’t find that in the time.h header in the NDK, only nanosleep. I can see that that function was present in earlier SDK versions, but mine (14/15, i.e. 4.0.3) doesn’t seem to have it.


#2

Thanks, I’ve fixed this now.