Patchwork [libcpp] Include <inttypes.h> if available

login
register
mail settings
Submitter Rainer Orth
Date Aug. 26, 2010, 5:20 p.m.
Message ID <ydd7hjd70kc.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/62793/
State New
Headers show

Comments

Rainer Orth - Aug. 26, 2010, 5:20 p.m.
The recent patch to libcpp/lex.c broke Tru64 UNIX V5.1B bootstrap: the
platform has uintptr_t, but it's only declared in <inttypes.h>.  To fix
this, this patch includes the header in system.h if it exists.  With it,
I can at least build libcpp and the bootstrap continues.

Ok for mainline (probably obvious)?

	Rainer


2010-08-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* system.h [HAVE_INTTYPES_H]: Include inttypes.h.
Tom Tromey - Aug. 26, 2010, 5:56 p.m.
>>>>> "Rainer" == Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

Rainer> 2010-08-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
Rainer> 	* system.h [HAVE_INTTYPES_H]: Include inttypes.h.

This is ok.  Thanks.

Tom

Patch

diff -r 0cf77b5772bf libcpp/system.h
--- a/libcpp/system.h	Mon Aug 23 13:25:29 2010 +0200
+++ b/libcpp/system.h	Thu Aug 26 19:04:15 2010 +0200
@@ -1,6 +1,6 @@ 
 /* Get common system includes and various definitions and declarations based
    on autoconf macros.
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2009
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2009, 2010
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -32,6 +32,9 @@ 
 #ifdef HAVE_STDINT_H
 # include <stdint.h>
 #endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
 
 #include <stdio.h>