Fix libcody build on hppa*-*-hpux11.11.
authorJohn David Anglin <danglin@gcc.gnu.org>
Wed, 6 Jan 2021 13:58:56 +0000 (13:58 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Wed, 6 Jan 2021 13:58:56 +0000 (13:58 +0000)
2021-01-06  John David Anglin  <danglin@gcc.gnu.org>

libcody/ChangeLog:

PR bootstrap/98506
* resolver.cc: Only use fstatat when _POSIX_C_SOURCE >= 200809L.

libcody/resolver.cc

index 7e9defb4eca12f9c664db51e4b6ce1671399835c..034fd63b9a880846f33ca04daf133ac01178d6ba 100644 (file)
@@ -10,7 +10,9 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
-#if (defined (__unix__)                                                        \
+#if ((defined (__unix__)                                               \
+      && defined _POSIX_C_SOURCE                                       \
+      && (_POSIX_C_SOURCE - 0) >= 200809L)                             \
      || (defined (__Apple__)                                           \
         && defined (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)     \
         && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101000))