Update:

This small example can also reproduce these compiler errors:
Qt Code:
  1. #include <iostream>
  2. #include <libnova/utiltiy.h>
  3.  
  4. int main() { return 0; }
To copy to clipboard, switch view to plain text mode 
Errors occure, because <iostream> also includes <pthread.h> somewhere down the road. And <pthread.h> has this funny stuff in it:

Qt Code:
  1. #undef gmtime_r
  2. #define gmtime_r(_Time,_Tm) ({ struct tm *___tmp_tm; \
  3. pthread_testcancel(); \
  4. ___tmp_tm = gmtime((_Time)); \
  5. if (___tmp_tm) { \
  6. *(_Tm) = *___tmp_tm; \
  7. ___tmp_tm = (_Tm); \
  8. } \
  9. ___tmp_tm; })
To copy to clipboard, switch view to plain text mode 

Then comes <libnova/utility.h> and declares:

Qt Code:
  1. struct tm *gmtime_r (time_t *t, struct tm *gmt);
To copy to clipboard, switch view to plain text mode 

When I include <libnova/utility.h> first, it will compile sucessfully. But being forced to include headers in a specific order feels very wrong. At least in this case. And it may not be possible in a very big project.

Is this a bug in the C library provided with MinGW?
What's the best way to handle this? For the time being, I could surround the conflicting declaratioin in <libnova/utility.h> with #ifndef...#endif.

Any advice?