system.h: Prior to #define, #undef fopen and freopen unconditionally.
authorOlivier Hainque <hainque@adacore.com>
Tue, 3 Jan 2012 11:44:34 +0000 (11:44 +0000)
committerOlivier Hainque <hainque@gcc.gnu.org>
Tue, 3 Jan 2012 11:44:34 +0000 (11:44 +0000)
gcc/
        * system.h: Prior to #define, #undef fopen and freopen unconditionally.

libcpp/
        * system.h: Likewise.

From-SVN: r182837

gcc/ChangeLog
gcc/system.h
libcpp/ChangeLog
libcpp/system.h

index c95a7ef05b79189048f9820d287f86e168e44e3f..dd3c6d7a2ff024ec76d110fc06c8a77c3d39af2d 100644 (file)
@@ -1,3 +1,7 @@
+2012-01-03  Olivier Hainque  <hainque@adacore.com>
+
+       * system.h: Prior to #define, #undef fopen and freopen unconditionally.
+
 2012-01-03  Olivier Hainque  <hainque@adacore.com>
 
        * collect2.c (main): In AIX specific computations for vector
index 0a943a3a3fe9c5363bb490d557a76a2f6d022224..51520e19f51cd1372068cb4dcd9ea351c5a63e9c 100644 (file)
@@ -47,9 +47,14 @@ along with GCC; see the file COPYING3.  If not see
 #endif
 
 /* Use the unlocked open routines from libiberty.  */
-#ifdef fopen /* fopen is a #define on VMS.  */
-#undef fopen
-#endif
+
+/* Some of these are #define on some systems, e.g. on AIX to redirect
+   the names to 64bit capable functions for LARGE_FILES support. These
+   redefs are pointless here so we can override them.  */
+
+#undef fopen 
+#undef freopen 
+
 #define fopen(PATH,MODE) fopen_unlocked(PATH,MODE)
 #define fdopen(FILDES,MODE) fdopen_unlocked(FILDES,MODE)
 #define freopen(PATH,MODE,STREAM) freopen_unlocked(PATH,MODE,STREAM)
index 261b8a52067df6fb076d03bf09a05b64f519417b..dfe18d08760afd397e736e34ee487235286d8b88 100644 (file)
@@ -1,3 +1,7 @@
+2012-01-03  Olivier Hainque  <hainque@adacore.com>
+
+       * system.h: Prior to #define, #undef fopen and freopen unconditionally.
+
 2011-12-20  Joseph Myers  <joseph@codesourcery.com>
 
        * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
index 0f15e12737ada3b7adbfdb9829bfb15fdc6b18fb..2a1f7096703b904f9ac896c23725f5f23dd2521a 100644 (file)
@@ -44,6 +44,14 @@ along with GCC; see the file COPYING3.  If not see
 #endif
 
 /* Use the unlocked open routines from libiberty.  */
+
+/* Some of these are #define on some systems, e.g. on AIX to redirect
+   the names to 64bit capable functions for LARGE_FILES support. These
+   redefs are pointless here so we can override them.  */
+    
+#undef fopen 
+#undef freopen 
+
 #define fopen(PATH,MODE) fopen_unlocked(PATH,MODE)
 #define fdopen(FILDES,MODE) fdopen_unlocked(FILDES,MODE)
 #define freopen(PATH,MODE,STREAM) freopen_unlocked(PATH,MODE,STREAM)