diff mbox

[Ada] Don't unconditionally define _LARGEFILE_SOURCE

Message ID ydd8un8l6f5.fsf@lokon.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Aug. 1, 2014, 12:51 p.m. UTC
This patch

2014-08-01  Pascal Obry  <obry@adacore.com>

        * cstreams.c: Only enable large file support on know supported
        platforms. Add missing defines/includes.

broke Ada bootstrap on Solaris:

/vol/gcc/src/hg/trunk/local/gcc/ada/cstreams.c:34:0: error: "_LARGEFILE_SOURCE" redefined [-Werror]
 #define _LARGEFILE_SOURCE
 ^
<built-in>: note: this is the location of the previous definition

Fixed as follows, i386-pc-solaris2.10 bootstrap is past the failure now.

Ok for mainline?

	Rainer


2014-08-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc/ada:
	* cstreams.c (_LARGEFILE_SOURCE): Guard definition.

Comments

Arnaud Charlet Aug. 1, 2014, 12:56 p.m. UTC | #1
> 2014-08-01  Pascal Obry  <obry@adacore.com>
> 
>         * cstreams.c: Only enable large file support on know supported
>         platforms. Add missing defines/includes.
> 
> broke Ada bootstrap on Solaris:
> 
> /vol/gcc/src/hg/trunk/local/gcc/ada/cstreams.c:34:0: error:
> "_LARGEFILE_SOURCE" redefined [-Werror]
>  #define _LARGEFILE_SOURCE
>  ^
> <built-in>: note: this is the location of the previous definition
> 
> Fixed as follows, i386-pc-solaris2.10 bootstrap is past the failure now.
> 
> Ok for mainline?

Yes, thanks.
diff mbox

Patch

diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c
--- a/gcc/ada/cstreams.c
+++ b/gcc/ada/cstreams.c
@@ -31,7 +31,9 @@ 
 
 /* Routines required for implementing routines in Interfaces.C.Streams.  */
 
+#ifndef _LARGEFILE_SOURCE
 #define _LARGEFILE_SOURCE
+#endif
 #define _FILE_OFFSET_BITS 64
 /* the define above will make off_t a 64bit type on GNU/Linux */