long long is supported at least on C99 so declare HAVE_LONG_LONG.

If at least C++11, then declare strto{u,}ll functions on libiberty.h to
fix hppa64-hp-hpux11.11 GCC bootstrap.

OK for hppa64 and trunk?

        PR bootstrap/128228

include/ChangeLog:

        * libiberty.h (HAVE_LONG_LONG): Define if
        __STDC_VERSION__ >= 199901L.
        (strtoll, strtoull): Define if __cplusplus >= 201103L.
---
 include/libiberty.h | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/include/libiberty.h b/include/libiberty.h
index e905f2cf190..d86d9ee8183 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -728,16 +728,25 @@ extern unsigned long int strtoul (const char *nptr,
                                   char **endptr, int base);
 #endif
 
-#if defined(HAVE_LONG_LONG) && defined(HAVE_DECL_STRTOLL) && !HAVE_DECL_STRTOLL
+/* hppa64-hp-hpux11.11 GCC bootstrap pass with this and
+   declare strto{u,}ll if at least C++11.  */
+#if __STDC_VERSION__ >= 199901L
+# undef HAVE_LONG_LONG
+# define HAVE_LONG_LONG 1
+#endif
+
+#if (defined(HAVE_LONG_LONG) || (defined(__cplusplus) && __cplusplus >= 
201103L))
+# if defined(HAVE_DECL_STRTOLL) && !HAVE_DECL_STRTOLL
 __extension__
 extern long long int strtoll (const char *nptr,
                               char **endptr, int base);
-#endif
+# endif
 
-#if defined(HAVE_LONG_LONG) && defined(HAVE_DECL_STRTOULL) && 
!HAVE_DECL_STRTOULL
+# if defined(HAVE_DECL_STRTOULL) && !HAVE_DECL_STRTOULL
 __extension__
 extern unsigned long long int strtoull (const char *nptr,
                                         char **endptr, int base);
+# endif
 #endif
 
 /* Set the title of a process */
-- 
2.56.0

Reply via email to