https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123406
--- Comment #7 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #6)
> Hmm, so maybe like this:
>
> AC_MSG_CHECKING([whether flockfile and putc_unlocked are defined in
> <stdio.h>])
> AC_TRY_COMPILE([
> #include <stdio.h>
> #if ! defined(__CYGWIN__) && __has_include(<newlib.h>)
> #error No usable flockfile on non-cygwin newlib targets
> #endif
> ],[
> FILE* f = ::fopen("", "");
> ::flockfile(f);
> ::putc_unlocked(' ', f);
> ::funlockfile(f);
> ::fclose(f);
> ],[ac_stdio_locking=yes],[ac_stdio_locking=no])
> AC_MSG_RESULT($ac_stdio_locking)
With possible future exception expressed using #ifndef around that #error?
That *should* do it, thanks.