diff options
author | Oleg Endo <oleg.endo@t-online.de> | 2013-06-20 19:22:02 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2013-06-20 15:22:02 -0400 |
commit | 469a31a98e086d65ed65fce224d88a45b9757828 (patch) | |
tree | d9f6cf10c4f9df22896b22cf0f3e699758688de2 | |
parent | 4ca5c232d025bf96bd70127dcb5940c4b227cbef (diff) | |
download | gcc-469a31a98e086d65ed65fce224d88a45b9757828.zip gcc-469a31a98e086d65ed65fce224d88a45b9757828.tar.gz gcc-469a31a98e086d65ed65fce224d88a45b9757828.tar.bz2 |
system.h: Include <cstdlib> as well as <stdlib.h>.
* system.h: Include <cstdlib> as well as <stdlib.h>.
Co-Authored-By: Jason Merrill <jason@redhat.com>
From-SVN: r200265
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/system.h | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 40a36c0..e3484bd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-06-20 Oleg Endo <oleg.endo@t-online.de> + Jason Merrill <jason@redhat.com> + + * system.h: Include <cstdlib> as well as <stdlib.h>. + 2013-06-20 Uros Bizjak <ubizjak@gmail.com> PR target/57655 diff --git a/gcc/system.h b/gcc/system.h index 41cd565..f10ba4a 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -226,6 +226,14 @@ extern int errno; # include <stdlib.h> #endif +/* When compiling C++ we need to include <cstdlib> as well as <stdlib.h> so + that it is processed before we poison "malloc"; otherwise, if a source + file uses a standard library header that includes <cstdlib>, we will get + an error about 'using std::malloc'. */ +#ifdef __cplusplus +#include <cstdlib> +#endif + /* Undef vec_free from AIX stdlib.h header which conflicts with vec.h. */ #undef vec_free |