This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, PR46650] Fix --enable-build-with-cxx bootstrap failure
- From: Jack Howarth <howarth at bromo dot med dot uc dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: joseph at codesourcery dot com
- Date: Thu, 25 Nov 2010 15:20:30 -0500
- Subject: [PATCH, PR46650] Fix --enable-build-with-cxx bootstrap failure
Currently the --enable-build-with-cxx bootstrap is broken due to r167010
which poisoned the strerror macro. The attached patch implements the proposed
solution of including the cstring c++ header instead of string.h and/or strings.h
when __cplusplus is defined. Bootstrap and regression tested on x86_64-apple-darwin10.
http://gcc.gnu.org/ml/gcc-testresults/2010-11/msg02099.html
Okay for gcc trunk?
Jack
2010-11-25 Jack Howarth <howarth@bromo.med.uc.edu>
Joseph Myers <joseph@codesourcery.com>
PR bootstrap/46650
* gcc/system.h: Include cstring for cxx bootstrap.
Index: gcc/system.h
===================================================================
--- gcc/system.h (revision 167136)
+++ gcc/system.h (working copy)
@@ -194,15 +194,19 @@
rely on (and therefore test) GCC's string builtins. */
#define __NO_STRING_INLINES
-#ifdef STRING_WITH_STRINGS
-# include <string.h>
-# include <strings.h>
+#ifdef __cplusplus
+# include <cstring>
#else
-# ifdef HAVE_STRING_H
+# ifdef STRING_WITH_STRINGS
# include <string.h>
+# include <strings.h>
# else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
+# ifdef HAVE_STRING_H
+# include <string.h>
+# else
+# ifdef HAVE_STRINGS_H
+# include <strings.h>
+# endif
# endif
# endif
#endif