This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

In libiberty/strerror.c, redefine sys_nerr before libiberty.h


I am about to commit this minor patch to libiberty/strerror.c.  This
moves the redefinition of sys_nerr and sys_errlist to before we
include libiberty.h and ansidecl.h.  This makes it safe for
libiberty.h to include system header files.

Ian


2004-04-13  Ian Lance Taylor  <ian@wasabisystems.com>

	* strerror.c: Include config.h, and redefine sys_nerr and
	sys_errlist, before including ansidecl.h and libiberty.h.


Index: strerror.c
===================================================================
RCS file: /cvs/gcc/gcc/libiberty/strerror.c,v
retrieving revision 1.12
diff -u -r1.12 strerror.c
--- strerror.c	2 Oct 2003 19:06:29 -0000	1.12
+++ strerror.c	13 Apr 2004 19:43:01 -0000
@@ -2,9 +2,6 @@
    Written by Fred Fish.  fnf@cygnus.com
    This file is in the public domain.  --Per Bothner.  */
 
-#include "ansidecl.h"
-#include "libiberty.h"
-
 #include "config.h"
 
 #ifdef HAVE_SYS_ERRLIST
@@ -16,6 +13,9 @@
 #define sys_nerr sys_nerr__
 #define sys_errlist sys_errlist__
 #endif
+
+#include "ansidecl.h"
+#include "libiberty.h"
 
 #include <stdio.h>
 #include <errno.h>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]