On mingw64 with c++11 support, the link libraries do contain a nanosleep function, while it isn't exposed via the headers. Using check_func_headers instead of a plain check_func fixes this misdetection.
Unified · Split
| @@ -4046,7 +4046,7 @@ check_func mkstemp · 4045 unmodified lines | |||
| 4046 | check_func mmap | 4046 | check_func mmap |
| 4047 | check_func mprotect | 4047 | check_func mprotect |
| 4048 | # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that | 4048 | # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that |
| 4049 | check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; } | 4049 | check_func_headers time.h nanosleep || { check_func_headers time.h nanosleep -lrt && add_extralibs -lrt; } |
| 4050 | check_func sched_getaffinity | 4050 | check_func sched_getaffinity |
| 4051 | check_func setrlimit | 4051 | check_func setrlimit |
| 4052 | check_func strerror_r | 4052 | check_func strerror_r |