diff mbox

Fix bootstrap on hppa*-*-hpux*

Message ID CBA3A4A7-CFF5-448B-9990-CB1A69EC71A4@bell.net
State New
Headers show

Commit Message

John David Anglin May 18, 2016, 12:31 a.m. UTC
r235550 introduced the use of long long, and the macros LLONG_MIN and LLONG_MAX.  These macros
are not defined by default and we need to include <climits> when compiling with c++ to define them.

Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.  Okay for trunk?

Dave
--
John David Anglin	dave.anglin@bell.net
2016-05-17  John David Anglin  <danglin@gcc.gnu.org>

	PR bootstrap/71014
	* system.h: Include climits instead of limits.h when compiling with c++.

Comments

Jakub Jelinek May 18, 2016, 6:20 a.m. UTC | #1
On Tue, May 17, 2016 at 08:31:00PM -0400, John David Anglin wrote:
> r235550 introduced the use of long long, and the macros LLONG_MIN and LLONG_MAX.  These macros
> are not defined by default and we need to include <climits> when compiling with c++ to define them.

IMNSHO we should get rid of those long long uses instead and just use
int64_t and INTTYPE_MINIMUM (int64_t) and INTTYPE_MAXIMUM (int64_t).

There is also another use of long long in libcpp, we should also replace
that.

> 2016-05-17  John David Anglin  <danglin@gcc.gnu.org>
> 
> 	PR bootstrap/71014
> 	* system.h: Include climits instead of limits.h when compiling with c++.
> 
> Index: system.h
> ===================================================================
> --- system.h	(revision 236287)
> +++ system.h	(working copy)
> @@ -301,8 +301,12 @@
>  # undef m_slot
>  #endif
>  
> -#if HAVE_LIMITS_H
> -# include <limits.h>
> +#ifdef __cplusplus
> +# include <climits>
> +#else
> +# if HAVE_LIMITS_H
> +#  include <limits.h>
> +# endif
>  #endif
>  
>  /* A macro to determine whether a VALUE lies inclusively within a


	Jakub
diff mbox

Patch

Index: system.h
===================================================================
--- system.h	(revision 236287)
+++ system.h	(working copy)
@@ -301,8 +301,12 @@ 
 # undef m_slot
 #endif
 
-#if HAVE_LIMITS_H
-# include <limits.h>
+#ifdef __cplusplus
+# include <climits>
+#else
+# if HAVE_LIMITS_H
+#  include <limits.h>
+# endif
 #endif
 
 /* A macro to determine whether a VALUE lies inclusively within a