diff options
65 files changed, 187 insertions, 479 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1bc7228eb1d..585429c21af 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,73 @@ +2010-11-29 Joseph Myers <joseph@codesourcery.com> + + * system.h: Include "safe-ctype.h" instead of <safe-ctype.h>. + Include <signal.h>, <sys/mman.h>, <sys/resource.h> and + <sys/times.h>. + (O_BINARY, SIGCHLD, MAP_FAILED, MAP_ANONYMOUS, kill): + Conditionally define. + (GET_ENVIRONMENT): Poison. + * configure.ac: Don't test for mincore. + * configure: Regenerate. + * config.in: Regenerate. + * collect2-aix.c: Don't include <sys/mman.h>. + * collect2.c: Don't include <signal.h>. + (SIGCHLD): Don't define. + (prefix_from_env): Use getenv instead of GET_ENVIRONMENT. + * config/alpha/alpha.c: Include "splay-tree.h" instead of + <splay-tree.h>. + * config/arm/arm.c (arm_target_help): Use getenv instead of + GET_ENVIRONMENT. + * config/avr/driver-avr.c: Don't include <stdlib.h>. + * config/frv/frv.c: Don't include <ctype.h>. + * config/host-darwin.c: Don't include <sys/mman.h>. + * config/host-hpux.c: Don't include <sys/mman.h> or <unistd.h>. + (MAP_FAILED): Don't define. + * config/host-linux.c: Don't include <sys/mman.h> or <limits.h>. + * config/host-solaris.c: Don't include <sys/mman.h>. + * config/i386/cygming.h: Don't include <stdio.h>. + * config/i386/driver-i386.c: Don't include <stdlib.h>. + * config/i386/host-cygwin.c: Don't include <sys/mman.h>. + * config/iq2000/iq2000.c: Don't include <signal.h>. + * config/m32c/m32c-pragma.c: Don't include <stdio.h>. + * config/m68hc11/m68hc11.c: Don't include <stdio.h>. + * config/mep/mep-pragma.c: Don't include <stdio.h>. + * config/microblaze/microblaze.c: Don't include <signal.h>. + * config/mips/mips.c: Don't include <signal.h>. + * config/rs6000/host-darwin.c: Don't include <signal.h>. + * cppdefault.c (cpp_relocated): Use getenv instead of + GET_ENVIRONMENT. + * defaults.h (GET_ENVIRONMENT): Don't define. + * et-forest.h: Don't include <ansidecl.h> or <stddef.h>. + * gcc.c: Don't include <signal.h>, <sys/mman.h> or <sys/types.h>. + (SIGCHLD, MAP_FAILED, kill): Don't define. + (process_command): Use getenv instead of GET_ENVIRONMENT. + * genhooks.c: Don't include <string.h>. + * ggc-common.c: Don't include <sys/resource.h>, <sys/mman.h> or + <sys/types.h>. + (MAP_FAILED): Don't define. + * ggc-page.c Don't include <sys/mman.h>. + (MAP_ANONYMOUS, MAP_FAILED): Don't define. + * ggc-zone.c: Don't include <sys/mman.h>. + (MAP_ANONYMOUS, MAP_FAILED): Don't define. + * graph.c: Include "config.h" instead of <config.h>. + * incpath.c (add_env_var_paths): Use getenv instead of + GET_ENVIRONMENT. + * lto-wrapper.c: Don't include <errno.h>, <signal.h> or + "libiberty.h". + (SIGCHLD, kill): Don't define. + * mips-tfile.c: Don't include <signal.h>. + * opts.c: Don't include <signal.h> or <sys/resource.h>. + (print_specific_help): Use getenv instead of GET_ENVIRONMENT. + * passes.c: Don't include <signal.h>, <sys/resource.h> or + <sys/times.h>. + * sparseset.h: Don't include <assert.h>. + * timevar.c: Don't include <sys/times.h> or <sys/resource.h>. + * tlink.c: Don't include "libiberty.h". + * toplev.c: Don't include <signal.h> or <sys/times.h>. + * tree-mudflap.c: Include "demangle.h" instead of <demangle.h>. + * tree-switch-conversion.c: Don't include <signal.h>. + * vmsdbgout.c: Don't include <errno.h> or <string.h>. + 2010-11-29 Nicola Pero <nicola.pero@meta-innovation.com> * c-parser.c (c_parser_objc_try_catch_statement): Renamed to diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 41ae904d66c..dadedfa041a 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,10 @@ +2010-11-29 Joseph Myers <joseph@codesourcery.com> + + * c-opts.c (check_deps_environment_vars): Use getenv instead of + GET_ENVIRONMENT. + * c-pch.c (O_BINARY): Don't define here. + * c-pragma.h: Include "cpplib.h" instead of <cpplib.h>. + 2010-11-25 Joseph Myers <joseph@codesourcery.com> * c-cppbuiltin.c (c_cpp_builtins): Pass &global_options to diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index 03af07ae8a8..befd64498a4 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -1131,12 +1131,12 @@ check_deps_environment_vars (void) { char *spec; - GET_ENVIRONMENT (spec, "DEPENDENCIES_OUTPUT"); + spec = getenv ("DEPENDENCIES_OUTPUT"); if (spec) cpp_opts->deps.style = DEPS_USER; else { - GET_ENVIRONMENT (spec, "SUNPRO_DEPENDENCIES"); + spec = getenv ("SUNPRO_DEPENDENCIES"); if (spec) { cpp_opts->deps.style = DEPS_SYSTEM; diff --git a/gcc/c-family/c-pch.c b/gcc/c-family/c-pch.c index 951ab1fc303..b863c25a93e 100644 --- a/gcc/c-family/c-pch.c +++ b/gcc/c-family/c-pch.c @@ -472,10 +472,6 @@ c_common_no_more_pch (void) /* Handle #pragma GCC pch_preprocess, to load in the PCH file. */ -#ifndef O_BINARY -# define O_BINARY 0 -#endif - void c_common_pch_pragma (cpp_reader *pfile, const char *name) { diff --git a/gcc/c-family/c-pragma.h b/gcc/c-family/c-pragma.h index 1c29ec455eb..cec9cd17616 100644 --- a/gcc/c-family/c-pragma.h +++ b/gcc/c-family/c-pragma.h @@ -21,7 +21,7 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_C_PRAGMA_H #define GCC_C_PRAGMA_H -#include <cpplib.h> /* For enum cpp_ttype. */ +#include "cpplib.h" /* For enum cpp_ttype. */ /* Pragma identifiers built in to the front end parsers. Identifiers for ancillary handlers will follow these. */ diff --git a/gcc/collect2-aix.c b/gcc/collect2-aix.c index 7d25e7e6b89..101826519e0 100644 --- a/gcc/collect2-aix.c +++ b/gcc/collect2-aix.c @@ -1,5 +1,5 @@ /* AIX cross support for collect2. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -25,8 +25,6 @@ along with GCC; see the file COPYING3. If not see #ifdef CROSS_AIX_SUPPORT -#include <sys/mman.h> - /* Read SIZE bytes starting at DATA as a big-endian value. */ static inline bfd_vma diff --git a/gcc/collect2.c b/gcc/collect2.c index 0d745ae0b8d..df91d34117d 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -30,10 +30,6 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tm.h" -#include <signal.h> -#if ! defined( SIGCHLD ) && defined( SIGCLD ) -# define SIGCHLD SIGCLD -#endif /* TARGET_64BIT may be defined to use driver specific functionality. */ #undef TARGET_64BIT @@ -822,7 +818,7 @@ static void prefix_from_env (const char *env, struct path_prefix *pprefix) { const char *p; - GET_ENVIRONMENT (p, env); + p = getenv (env); if (p) prefix_from_string (p, pprefix); diff --git a/gcc/config.in b/gcc/config.in index b6a95b53e19..7c5c617102a 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1251,12 +1251,6 @@ #endif -/* Define to 1 if you have the `mincore' function. */ -#ifndef USED_FOR_TARGET -#undef HAVE_MINCORE -#endif - - /* Define to 1 if you have the `mmap' function. */ #ifndef USED_FOR_TARGET #undef HAVE_MMAP diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index eb35367f9f6..1ecd2c4d70f 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -50,7 +50,7 @@ along with GCC; see the file COPYING3. If not see #include "target-def.h" #include "debug.h" #include "langhooks.h" -#include <splay-tree.h> +#include "splay-tree.h" #include "cfglayout.h" #include "gimple.h" #include "tree-flow.h" diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index f9fbb197a8b..53a847d7615 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -1364,7 +1364,7 @@ arm_target_help (void) { const char *p; - GET_ENVIRONMENT (p, "COLUMNS"); + p = getenv ("COLUMNS"); if (p != NULL) { int value = atoi (p); diff --git a/gcc/config/avr/driver-avr.c b/gcc/config/avr/driver-avr.c index 55af6516d29..6ab0bb822ef 100755 --- a/gcc/config/avr/driver-avr.c +++ b/gcc/config/avr/driver-avr.c @@ -1,5 +1,5 @@ /* Subroutines for the gcc driver. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. Contributed by Anatoly Sokolov <aesok@post.ru> This file is part of GCC. @@ -22,7 +22,6 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tm.h" -#include <stdlib.h> /* Current architecture. */ const struct base_arch_s *avr_current_arch = NULL; diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index 5003bb7d6eb..f8653c761e0 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -44,7 +44,6 @@ along with GCC; see the file COPYING3. If not see #include "basic-block.h" #include "tm_p.h" #include "ggc.h" -#include <ctype.h> #include "target.h" #include "target-def.h" #include "targhooks.h" diff --git a/gcc/config/host-darwin.c b/gcc/config/host-darwin.c index 223abb89968..3fd0a71c33e 100644 --- a/gcc/config/host-darwin.c +++ b/gcc/config/host-darwin.c @@ -1,5 +1,5 @@ /* Darwin host-specific hook definitions. - Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -20,7 +20,6 @@ #include "config.h" #include "system.h" #include "coretypes.h" -#include <sys/mman.h> #include "diagnostic-core.h" #include "toplev.h" #include "config/host-darwin.h" diff --git a/gcc/config/host-hpux.c b/gcc/config/host-hpux.c index 6fe2b5537dd..00adfcf9b5b 100644 --- a/gcc/config/host-hpux.c +++ b/gcc/config/host-hpux.c @@ -1,5 +1,5 @@ /* HP-UX host-specific hook definitions. - Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -20,15 +20,9 @@ #include "config.h" #include "system.h" #include "coretypes.h" -#include <sys/mman.h> -#include <unistd.h> #include "hosthooks.h" #include "hosthooks-def.h" -#ifndef MAP_FAILED -#define MAP_FAILED (void *)-1L -#endif - static void *hpux_gt_pch_get_address (size_t, int); static int hpux_gt_pch_use_address (void *, size_t, int, size_t); diff --git a/gcc/config/host-linux.c b/gcc/config/host-linux.c index 9f6ef0a1319..47ce3ea90a7 100644 --- a/gcc/config/host-linux.c +++ b/gcc/config/host-linux.c @@ -1,5 +1,5 @@ /* Linux host-specific hook definitions. - Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007, 2008, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -20,8 +20,6 @@ #include "config.h" #include "system.h" #include "coretypes.h" -#include <sys/mman.h> -#include <limits.h> #include "hosthooks.h" #include "hosthooks-def.h" diff --git a/gcc/config/host-solaris.c b/gcc/config/host-solaris.c index 835832b9c21..12eab3c61b8 100644 --- a/gcc/config/host-solaris.c +++ b/gcc/config/host-solaris.c @@ -20,7 +20,6 @@ #include "config.h" #include "system.h" #include "coretypes.h" -#include <sys/mman.h> #include "hosthooks.h" #include "hosthooks-def.h" diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h index 28c3082bd59..733c7c79a37 100644 --- a/gcc/config/i386/cygming.h +++ b/gcc/config/i386/cygming.h @@ -118,8 +118,6 @@ along with GCC; see the file COPYING3. If not see #define TARGET_EXECUTABLE_SUFFIX ".exe" -#include <stdio.h> - #define TARGET_OS_CPP_BUILTINS() \ do \ { \ diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c index 0e13162485e..bf7ec0c81a3 100644 --- a/gcc/config/i386/driver-i386.c +++ b/gcc/config/i386/driver-i386.c @@ -21,7 +21,6 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tm.h" -#include <stdlib.h> const char *host_detect_local_cpu (int argc, const char **argv); diff --git a/gcc/config/i386/host-cygwin.c b/gcc/config/i386/host-cygwin.c index ac699b3bf01..8510bde125e 100644 --- a/gcc/config/i386/host-cygwin.c +++ b/gcc/config/i386/host-cygwin.c @@ -1,5 +1,5 @@ /* Cygwin host-specific hook definitions. - Copyright (C) 2004, 2007 Free Software Foundation, Inc. + Copyright (C) 2004, 2007, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -20,7 +20,6 @@ #include "config.h" #include "system.h" #include "coretypes.h" -#include <sys/mman.h> #include "hosthooks.h" #include "hosthooks-def.h" #include "toplev.h" diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index 433af644def..cc4c80f2836 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -21,7 +21,6 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "system.h" #include "coretypes.h" -#include <signal.h> #include "tm.h" #include "tree.h" #include "rtl.h" diff --git a/gcc/config/m32c/m32c-pragma.c b/gcc/config/m32c/m32c-pragma.c index f3f1ca9dea0..fda6a6b54a3 100644 --- a/gcc/config/m32c/m32c-pragma.c +++ b/gcc/config/m32c/m32c-pragma.c @@ -1,5 +1,5 @@ /* M32C Pragma support - Copyright (C) 2004, 2007 Free Software Foundation, Inc. + Copyright (C) 2004, 2007, 2010 Free Software Foundation, Inc. Contributed by Red Hat, Inc. This file is part of GCC. @@ -18,7 +18,6 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ -#include <stdio.h> #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c index f8a67ba779e..00d409e8aac 100644 --- a/gcc/config/m68hc11/m68hc11.c +++ b/gcc/config/m68hc11/m68hc11.c @@ -32,7 +32,6 @@ Note: */ -#include <stdio.h> #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/config/mep/mep-pragma.c b/gcc/config/mep/mep-pragma.c index 1c9651a0699..1e37403c779 100644 --- a/gcc/config/mep/mep-pragma.c +++ b/gcc/config/mep/mep-pragma.c @@ -1,5 +1,5 @@ /* Definitions of Toshiba Media Processor - Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2009 Free + Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. Contributed by Red Hat, Inc. This file is part of GCC. @@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ -#include <stdio.h> #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c index efa000c49c0..2cd28fc8932 100644 --- a/gcc/config/microblaze/microblaze.c +++ b/gcc/config/microblaze/microblaze.c @@ -22,7 +22,6 @@ #include "config.h" #include "system.h" #include "coretypes.h" -#include <signal.h> #include "tm.h" #include "rtl.h" #include "regs.h" diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 23907b68b93..7e7e428d17f 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -27,7 +27,6 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tm.h" -#include <signal.h> #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" diff --git a/gcc/config/rs6000/host-darwin.c b/gcc/config/rs6000/host-darwin.c index 333f4884e1b..ca1f6bbb229 100644 --- a/gcc/config/rs6000/host-darwin.c +++ b/gcc/config/rs6000/host-darwin.c @@ -1,5 +1,5 @@ /* Darwin/powerpc host-specific hook definitions. - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -21,7 +21,6 @@ #include "config.h" #include "system.h" #include "coretypes.h" -#include <signal.h> #include <sys/ucontext.h> #include "hosthooks.h" #include "hosthooks-def.h" diff --git a/gcc/configure b/gcc/configure index ce8a6762fa6..e1866a4e538 100755 --- a/gcc/configure +++ b/gcc/configure @@ -8610,7 +8610,7 @@ fi for ac_func in times clock kill getrlimit setrlimit atoll atoq \ sysconf strsignal getrusage nl_langinfo \ - gettimeofday mbstowcs wcswidth mmap mincore setlocale \ + gettimeofday mbstowcs wcswidth mmap setlocale \ clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` diff --git a/gcc/configure.ac b/gcc/configure.ac index b8f35af93e8..dace19c9f96 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -974,7 +974,7 @@ define(gcc_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl putchar_unlocked putc_unlocked) AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoll atoq \ sysconf strsignal getrusage nl_langinfo \ - gettimeofday mbstowcs wcswidth mmap mincore setlocale \ + gettimeofday mbstowcs wcswidth mmap setlocale \ gcc_UNLOCKED_FUNCS) if test x$ac_cv_func_mbstowcs = xyes; then diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c index bd705ffb625..9b1495feb94 100644 --- a/gcc/cppdefault.c +++ b/gcc/cppdefault.c @@ -1,6 +1,6 @@ /* CPP Library. Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. + 1999, 2000, 2003, 2004, 2006, 2007, 2010 Free Software Foundation, Inc. Contributed by Per Bothner, 1994-95. Based on CCCP program by Paul Rubin, June 1986 Adapted to ANSI C, Richard Stallman, Jan 1987 @@ -127,7 +127,7 @@ cpp_relocated (void) if (relocated == -1) { /* Check if the toolchain was relocated? */ - GET_ENVIRONMENT (gcc_exec_prefix, "GCC_EXEC_PREFIX"); + gcc_exec_prefix = getenv ("GCC_EXEC_PREFIX"); if (gcc_exec_prefix) relocated = 1; else diff --git a/gcc/defaults.h b/gcc/defaults.h index 77e7685f3b0..815ddd243f8 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -28,10 +28,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #ifndef GCC_DEFAULTS_H #define GCC_DEFAULTS_H -#ifndef GET_ENVIRONMENT -#define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0) -#endif - /* Store in OUTPUT a string (made with alloca) containing an assembler-name for a local static variable or function named NAME. LABELNO is an integer which is different for each call. */ diff --git a/gcc/et-forest.h b/gcc/et-forest.h index 8f49a82ad62..06bd82e3e8f 100644 --- a/gcc/et-forest.h +++ b/gcc/et-forest.h @@ -1,5 +1,6 @@ /* Et-forest data structure implementation. - Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2007, 2010 + Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -48,9 +49,6 @@ #ifndef _ET_TREE_H #define _ET_TREE_H -#include <ansidecl.h> -#include <stddef.h> - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index b7901ad417b..f8e8e20d01a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2010-11-29 Joseph Myers <joseph@codesourcery.com> + + * gfortran.h (alloca): Don't include definitions. + (NULL): Don't define. + 2010-11-28 Janus Weil <janus@gcc.gnu.org> PR fortran/46662 diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index d8dd14782e7..52f11c53787 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -38,24 +38,6 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "input.h" #include "splay-tree.h" -/* The following ifdefs are recommended by the autoconf documentation - for any code using alloca. */ - -/* AIX requires this to be the first thing in the file. */ -#ifdef __GNUC__ -#else /* not __GNUC__ */ -#ifdef HAVE_ALLOCA_H -#include <alloca.h> -#else /* do not HAVE_ALLOCA_H */ -#ifdef _AIX -#pragma alloca -#else -#ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -#endif /* not predefined */ -#endif /* not _AIX */ -#endif /* do not HAVE_ALLOCA_H */ -#endif /* not __GNUC__ */ /* Major control parameters. */ @@ -70,10 +52,6 @@ char *alloca (); #define free(x) Use_gfc_free_instead_of_free() #define gfc_is_whitespace(c) ((c==' ') || (c=='\t')) -#ifndef NULL -#define NULL ((void *) 0) -#endif - /* Stringization. */ #define stringize(x) expand_macro(x) #define expand_macro(x) # x diff --git a/gcc/gcc.c b/gcc/gcc.c index c2998bd96b8..1e525b53c30 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -35,10 +35,6 @@ compilation is specified by a string called a "spec". */ #include "coretypes.h" #include "multilib.h" /* before tm.h */ #include "tm.h" -#include <signal.h> -#if ! defined( SIGCHLD ) && defined( SIGCLD ) -# define SIGCHLD SIGCLD -#endif #include "xregex.h" #include "obstack.h" #include "intl.h" @@ -49,18 +45,6 @@ compilation is specified by a string called a "spec". */ #include "opts.h" #include "vec.h" -#ifdef HAVE_MMAP_FILE -# include <sys/mman.h> -# ifdef HAVE_MINCORE -/* This is on Solaris. */ -# include <sys/types.h> -# endif -#endif - -#ifndef MAP_FAILED -# define MAP_FAILED ((void *)-1) -#endif - /* By default there is no special suffix for target executables. */ /* FIXME: when autoconf is fixed, remove the host check - dj */ #if defined(TARGET_EXECUTABLE_SUFFIX) && defined(HOST_EXECUTABLE_SUFFIX) @@ -88,10 +72,6 @@ static const char dir_separator_str[] = { DIR_SEPARATOR, 0 }; #define LIBRARY_PATH_ENV "LIBRARY_PATH" #endif -#ifndef HAVE_KILL -#define kill(p,s) raise(s) -#endif - /* If a stage of compilation returns an exit status >= 1, compilation of that file ceases. */ @@ -3506,7 +3486,7 @@ process_command (unsigned int decoded_options_count, struct cl_option_handlers handlers; unsigned int j; - GET_ENVIRONMENT (gcc_exec_prefix, "GCC_EXEC_PREFIX"); + gcc_exec_prefix = getenv ("GCC_EXEC_PREFIX"); n_switches = 0; n_infiles = 0; @@ -3611,7 +3591,7 @@ process_command (unsigned int decoded_options_count, /* COMPILER_PATH and LIBRARY_PATH have values that are lists of directory names with colons. */ - GET_ENVIRONMENT (temp, "COMPILER_PATH"); + temp = getenv ("COMPILER_PATH"); if (temp) { const char *startp, *endp; @@ -3645,7 +3625,7 @@ process_command (unsigned int decoded_options_count, } } - GET_ENVIRONMENT (temp, LIBRARY_PATH_ENV); + temp = getenv (LIBRARY_PATH_ENV); if (temp && *cross_compile == '0') { const char *startp, *endp; @@ -3678,7 +3658,7 @@ process_command (unsigned int decoded_options_count, } /* Use LPATH like LIBRARY_PATH (for the CMU build program). */ - GET_ENVIRONMENT (temp, "LPATH"); + temp = getenv ("LPATH"); if (temp && *cross_compile == '0') { const char *startp, *endp; diff --git a/gcc/genhooks.c b/gcc/genhooks.c index a9eecd79a92..6d924487938 100644 --- a/gcc/genhooks.c +++ b/gcc/genhooks.c @@ -19,7 +19,6 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #include "bconfig.h" #include "system.h" -#include <string.h> #include "hashtab.h" #include "errors.h" diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index 2c3c8b3061d..b7f1524387f 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -36,22 +36,6 @@ along with GCC; see the file COPYING3. If not see #include "vec.h" #include "timevar.h" -#ifdef HAVE_SYS_RESOURCE_H -# include <sys/resource.h> -#endif - -#ifdef HAVE_MMAP_FILE -# include <sys/mman.h> -# ifdef HAVE_MINCORE -/* This is on Solaris. */ -# include <sys/types.h> -# endif -#endif - -#ifndef MAP_FAILED -# define MAP_FAILED ((void *)-1) -#endif - /* When set, ggc_collect will do collection. */ bool ggc_force_collect; diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index c0d2f9adce4..3104058e8c7 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -40,26 +40,11 @@ along with GCC; see the file COPYING3. If not see file open. Prefer either to valloc. */ #ifdef HAVE_MMAP_ANON # undef HAVE_MMAP_DEV_ZERO - -# include <sys/mman.h> -# ifndef MAP_FAILED -# define MAP_FAILED -1 -# endif -# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON) -# define MAP_ANONYMOUS MAP_ANON -# endif # define USING_MMAP - #endif #ifdef HAVE_MMAP_DEV_ZERO - -# include <sys/mman.h> -# ifndef MAP_FAILED -# define MAP_FAILED -1 -# endif # define USING_MMAP - #endif #ifndef USING_MMAP diff --git a/gcc/ggc-zone.c b/gcc/ggc-zone.c index 0fd5c2b234a..bd68008f63b 100644 --- a/gcc/ggc-zone.c +++ b/gcc/ggc-zone.c @@ -43,22 +43,10 @@ along with GCC; see the file COPYING3. If not see file open. Prefer either to valloc. */ #ifdef HAVE_MMAP_ANON # undef HAVE_MMAP_DEV_ZERO - -# include <sys/mman.h> -# ifndef MAP_FAILED -# define MAP_FAILED -1 -# endif -# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON) -# define MAP_ANONYMOUS MAP_ANON -# endif # define USING_MMAP #endif #ifdef HAVE_MMAP_DEV_ZERO -# include <sys/mman.h> -# ifndef MAP_FAILED -# define MAP_FAILED -1 -# endif # define USING_MMAP #endif diff --git a/gcc/graph.c b/gcc/graph.c index 64e6c3fe15d..d3513fde70b 100644 --- a/gcc/graph.c +++ b/gcc/graph.c @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ -#include <config.h> +#include "config.h" #include "system.h" #include "coretypes.h" #include "tm.h" diff --git a/gcc/incpath.c b/gcc/incpath.c index 91bd24154db..512659835e4 100644 --- a/gcc/incpath.c +++ b/gcc/incpath.c @@ -100,7 +100,7 @@ add_env_var_paths (const char *env_var, int chain) { char *p, *q, *path; - GET_ENVIRONMENT (q, env_var); + q = getenv (env_var); if (!q) return; diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 05cbb037509..075d183a8df 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,19 @@ +2010-11-29 Joseph Myers <joseph@codesourcery.com> + + * boehm.c: Include "config.h" instead of <config.h>. + * builtins.c: Don't include <stdarg.h>. + * class.c: Don't include "stdio.h". + (O_BINARY): Don't define here. + * jcf-depend.c: Don't include <assert.h>. + (jcf_dependency_set_dep_file, jcf_dependency_init, + jcf_dependency_write): Use gcc_assert. + * jcf-io.c (O_BINARY): Don't define here. + * jcf-path.c: Don't include "tm.h". + (jcf_path_init): Use getenv instead of GET_ENVIRONMENT. + * resource.c: Don't include "stdio.h". + (O_BINARY): Don't define here. + * verify-impl.c: Don't include <stdio.h>. + 2010-11-17 Joseph Myers <joseph@codesourcery.com> * jcf-parse.c (java_parse_file): Take no arguments. diff --git a/gcc/java/boehm.c b/gcc/java/boehm.c index 2a0690ce51d..ce0ca2d790f 100644 --- a/gcc/java/boehm.c +++ b/gcc/java/boehm.c @@ -1,5 +1,6 @@ /* Functions related to the Boehm garbage collector. - Copyright (C) 2000, 2003, 2004, 2006, 2009 Free Software Foundation, Inc. + Copyright (C) 2000, 2003, 2004, 2006, 2009, 2010 + Free Software Foundation, Inc. This file is part of GCC. @@ -23,8 +24,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ /* Written by Tom Tromey <tromey@cygnus.com>. */ -#include <config.h> - +#include "config.h" #include "system.h" #include "coretypes.h" #include "double-int.h" diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c index fbaaf3e9bc7..2100f093a49 100644 --- a/gcc/java/builtins.c +++ b/gcc/java/builtins.c @@ -36,7 +36,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "flags.h" #include "langhooks.h" #include "java-tree.h" -#include <stdarg.h> /* FIXME: All these headers are necessary for sync_compare_and_swap. Front ends should never have to look at that. */ diff --git a/gcc/java/class.c b/gcc/java/class.c index a1dc9c08b25..92091f9e9cf 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -38,18 +38,12 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "parse.h" #include "function.h" #include "ggc.h" -#include "stdio.h" #include "cgraph.h" #include "tree-iterator.h" #include "vecprim.h" #include "tm.h" /* FIXME: For gcc_obstack_init from defaults.h. */ #include "target.h" -/* DOS brain-damage */ -#ifndef O_BINARY -#define O_BINARY 0 /* MS-DOS brain-damage */ -#endif - static tree make_method_value (tree); static tree build_java_method_type (tree, tree, int); static int32 hashUtf8String (const char *, int); diff --git a/gcc/java/jcf-depend.c b/gcc/java/jcf-depend.c index c93c73bf915..cde2a8dc72d 100644 --- a/gcc/java/jcf-depend.c +++ b/gcc/java/jcf-depend.c @@ -1,6 +1,6 @@ /* Functions for handling dependency tracking when reading .class files. - Copyright (C) 1998, 1999, 2000, 2001, 2003, 2006, 2007 + Copyright (C) 1998, 1999, 2000, 2001, 2003, 2006, 2007, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -30,8 +30,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "coretypes.h" #include "mkdeps.h" -#include <assert.h> - #include "jcf.h" @@ -89,7 +87,7 @@ jcf_dependency_add_target (const char *name) void jcf_dependency_set_dep_file (const char *name) { - assert (dep_out != stdout); + gcc_assert (dep_out != stdout); if (dep_out) fclose (dep_out); if (! strcmp (name, "-")) @@ -117,7 +115,7 @@ jcf_dependency_add_file (const char *filename ATTRIBUTE_UNUSED, int system_p) void jcf_dependency_init (int system_p) { - assert (! dependencies); + gcc_assert (! dependencies); system_files = system_p; dependencies = deps_init (); } @@ -134,7 +132,7 @@ jcf_dependency_write (void) if (! dep_out) return; - assert (dependencies); + gcc_assert (dependencies); deps_write (dependencies, dep_out, 72); if (print_dummies) diff --git a/gcc/java/jcf-io.c b/gcc/java/jcf-io.c index 1c455da2101..0dc761534c6 100644 --- a/gcc/java/jcf-io.c +++ b/gcc/java/jcf-io.c @@ -1,6 +1,6 @@ /* Utility routines for finding and reading Java(TM) .class files. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -36,11 +36,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "zlib.h" -/* DOS brain-damage */ -#ifndef O_BINARY -#define O_BINARY 0 /* MS-DOS brain-damage */ -#endif - int jcf_unexpected_eof (JCF *jcf, int count ATTRIBUTE_UNUSED) { diff --git a/gcc/java/jcf-path.c b/gcc/java/jcf-path.c index 04764c381d8..16ec65538d0 100644 --- a/gcc/java/jcf-path.c +++ b/gcc/java/jcf-path.c @@ -1,6 +1,6 @@ /* Handle CLASSPATH, -classpath, and path searching. Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, - 2007, 2008 Free Software Foundation, Inc. + 2007, 2008, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -27,7 +27,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "config.h" #include "system.h" #include "coretypes.h" -#include "tm.h" /* FIXME: For GET_ENVIRONMENT from defaults.h. */ #include <dirent.h> @@ -224,7 +223,7 @@ jcf_path_init (void) sep[0] = DIR_SEPARATOR; sep[1] = '\0'; - GET_ENVIRONMENT (cp, "GCC_EXEC_PREFIX"); + cp = getenv ("GCC_EXEC_PREFIX"); if (cp) { attempt = (char *) alloca (strlen (cp) + 50); @@ -295,7 +294,7 @@ jcf_path_init (void) jcf_path_extdirs_arg (extdirs); } - GET_ENVIRONMENT (cp, "CLASSPATH"); + cp = getenv ("CLASSPATH"); add_path (&classpath_env, cp, 0); } diff --git a/gcc/java/resource.c b/gcc/java/resource.c index f954024fde1..25a9bdd223a 100644 --- a/gcc/java/resource.c +++ b/gcc/java/resource.c @@ -1,6 +1,6 @@ /* Functions related to building resource files. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2007, 2008 Free Software Foundation, Inc. + 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -34,15 +34,9 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "parse.h" #include "function.h" #include "ggc.h" -#include "stdio.h" #include "tree-iterator.h" #include "cgraph.h" -/* DOS brain-damage */ -#ifndef O_BINARY -#define O_BINARY 0 /* MS-DOS brain-damage */ -#endif - /* A list of all the resources files. */ static GTY(()) VEC(tree,gc) *resources; diff --git a/gcc/java/verify-impl.c b/gcc/java/verify-impl.c index 12861214e30..1ca2d9fd66b 100644 --- a/gcc/java/verify-impl.c +++ b/gcc/java/verify-impl.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 +/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 Free Software Foundation This file is part of libgcj. @@ -19,10 +19,6 @@ details. */ /* Hack to work around namespace pollution from java-tree.h. */ #undef current_class -#ifdef VERIFY_DEBUG -#include <stdio.h> -#endif /* VERIFY_DEBUG */ - /* This is used to mark states which are not scheduled for verification. */ #define INVALID_STATE ((state *) -1) diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c index d0a80ad2f39..143e3fd1b66 100644 --- a/gcc/lto-wrapper.c +++ b/gcc/lto-wrapper.c @@ -40,19 +40,9 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "system.h" #include "coretypes.h" -#include <errno.h> -#include <signal.h> -#if ! defined( SIGCHLD ) && defined( SIGCLD ) -# define SIGCHLD SIGCLD -#endif #include "intl.h" -#include "libiberty.h" #include "obstack.h" -#ifndef HAVE_KILL -#define kill(p,s) raise(s) -#endif - int debug; /* true if -save-temps. */ int verbose; /* true if -v. */ diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 7df4c50f9ad..5bc6468c0f6 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,11 @@ +2010-11-29 Joseph Myers <joseph@codesourcery.com> + + * lto-endian.h: Delete. + * lto-object.c: Don't include "libiberty.h". + (O_BINARY): Don't define. + * lto.c: Don't include "libiberty.h" or <sys/mman.h>. + (O_BINARY): Don't define. + 2010-11-23 Richard Guenther <rguenther@suse.de> * lto.c (read_cgraph_and_symbols): Remove newline from diagnostic. diff --git a/gcc/lto/lto-endian.h b/gcc/lto/lto-endian.h deleted file mode 100644 index 1f51cee79e9..00000000000 --- a/gcc/lto/lto-endian.h +++ /dev/null @@ -1,205 +0,0 @@ -/* Very simple endian-ness layer for LTO object file handling - Copyright 2010 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 3, or (at your option) any later -version. - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING3. If not see -<http://www.gnu.org/licenses/>. */ - -/* This header file provides a simple way to handle object files in - another endian-ness than the host machine. This is necesarry to - enable cross-compilation with LTO enabled. Targets that use the - ELF binary object format do not need this (libelf already handles - endian-ness) but for COFF and Mach-O the functions in this header - are used in the minimal binary object reader/writer. - - For all functions in this header, the user is responsible for - making sure that the memory accesses are valid. */ - -#ifndef GCC_LTO_ENDIAN_H -#define GCC_LTO_ENDIAN_H - -#include <stdint.h> -#include <inttypes.h> - -static inline uint16_t -get_uint16_le (const unsigned char *ptr) -{ - return ptr[0] | (ptr[1] << 8); -} - -static inline uint32_t -get_uint32_le (const unsigned char *ptr) -{ - return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24); -} - -static inline uint64_t -get_uint64_le (const unsigned char *ptr_) -{ -#define ptr (uint64_t) ptr_ - return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24) - | (ptr[4] << 32) | (ptr[5] << 40) | (ptr[6] << 48) | (ptr[7] << 56); -#undef ptr -} - -static inline uint16_t -get_uint16_be (const unsigned char *ptr) -{ - return ptr[1] | (ptr[2] << 8); -} - -static inline uint32_t -get_uint32_be (const unsigned char *ptr) -{ - return ptr[3] | (ptr[2] << 8) | (ptr[1] << 16) | (ptr[0] << 24); -} - -static inline uint64_t -get_uint64_be (const unsigned char *ptr_) -{ -#define ptr (uint64_t) ptr_ - return ptr[7] | (ptr[6] << 8) | (ptr[5] << 16) | (ptr[4] << 24) - | (ptr[3] << 32) | (ptr[2] << 40) | (ptr[1] << 48) | (ptr[0] << 56); -#undef ptr -} - -static inline void -put_uint16_le (unsigned char *ptr, uint16_t data) -{ - ptr[0] = data & 0xff; - ptr[1] = (data >> 8) & 0xff; -} - -static inline void -put_uint32_le (unsigned char *ptr, uint32_t data) -{ - ptr[0] = data & 0xff; - ptr[1] = (data >> 8) & 0xff; - ptr[2] = (data >> 16) & 0xff; - ptr[3] = (data >> 24) & 0xff; -} - -static inline void -put_uint64_le (unsigned char *ptr, uint64_t data) -{ - ptr[0] = data & 0xff; - ptr[1] = (data >> 8) & 0xff; - ptr[2] = (data >> 16) & 0xff; - ptr[3] = (data >> 24) & 0xff; - ptr[4] = (data >> 32) & 0xff; - ptr[5] = (data >> 40) & 0xff; - ptr[6] = (data >> 48) & 0xff; - ptr[7] = (data >> 56) & 0xff; -} - -static inline void -put_uint16_be (unsigned char *ptr, uint16_t data) -{ - ptr[1] = data & 0xff; - ptr[0] = (data >> 8) & 0xff; -} - -static inline void -put_uint32_be (unsigned char *ptr, uint32_t data) -{ - ptr[3] = data & 0xff; - ptr[2] = (data >> 8) & 0xff; - ptr[1] = (data >> 16) & 0xff; - ptr[0] = (data >> 24) & 0xff; -} - -static inline void -put_uint64_be (unsigned char *ptr, uint64_t data) -{ - ptr[7] = data & 0xff; - ptr[6] = (data >> 8) & 0xff; - ptr[5] = (data >> 16) & 0xff; - ptr[4] = (data >> 24) & 0xff; - ptr[3] = (data >> 32) & 0xff; - ptr[2] = (data >> 40) & 0xff; - ptr[1] = (data >> 48) & 0xff; - ptr[0] = (data >> 56) & 0xff; -} - -static inline void -get_string (unsigned char *ptr, char *dest, size_t len) -{ - memcpy (dest, ptr, len); -} - -static inline void -put_string (unsigned char *ptr, char *src, size_t len) -{ - memcpy (ptr, src, len); -} - -/* Use the target macro BYTES_BIG_ENDIAN to choose. */ - -static inline uint16_t -get_uint16 (const unsigned char *ptr) -{ - if (BYTES_BIG_ENDIAN) - return get_uint16_be (ptr); - else - return get_uint16_le (ptr); -} - -static inline uint32_t -get_uint32 (const unsigned char *ptr) -{ - if (BYTES_BIG_ENDIAN) - return get_uint32_be (ptr); - else - return get_uint32_le (ptr); -} - -static inline uint64_t -get_uint64 (const unsigned char *ptr) -{ - if (BYTES_BIG_ENDIAN) - return get_uint64_be (ptr); - else - return get_uint64_le (ptr); -} - -static inline void -put_uint16 (unsigned char *ptr, uint16_t data) -{ - if (BYTES_BIG_ENDIAN) - put_uint16_be (ptr, data); - else - put_uint16_le (ptr, data); -} - -static inline void -put_uint32 (unsigned char *ptr, uint32_t data) -{ - if (BYTES_BIG_ENDIAN) - put_uint32_be (ptr, data); - else - put_uint32_le (ptr, data); -} - -static inline void -put_uint64 (unsigned char *ptr, uint64_t data) -{ - if (BYTES_BIG_ENDIAN) - put_uint64_be (ptr, data); - else - put_uint64_le (ptr, data); -} - -#endif /* GCC_LTO_ENDIAN_H */ - diff --git a/gcc/lto/lto-object.c b/gcc/lto/lto-object.c index 4a67580d2d3..21da20b052a 100644 --- a/gcc/lto/lto-object.c +++ b/gcc/lto/lto-object.c @@ -26,15 +26,8 @@ along with GCC; see the file COPYING3. If not see #include "lto.h" #include "tm.h" #include "lto-streamer.h" -#include "libiberty.h" #include "simple-object.h" -/* Handle opening elf files on hosts, such as Windows, that may use - text file handling that will break binary access. */ -#ifndef O_BINARY -# define O_BINARY 0 -#endif - /* Segment name for LTO sections. This is only used for Mach-O. FIXME: This needs to be kept in sync with darwin.c. */ diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 3db5ac1bbd8..9cfb5e272c7 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -26,7 +26,6 @@ along with GCC; see the file COPYING3. If not see #include "tree.h" #include "diagnostic-core.h" #include "tm.h" -#include "libiberty.h" #include "cgraph.h" #include "ggc.h" #include "tree-ssa-operands.h" @@ -46,20 +45,6 @@ along with GCC; see the file COPYING3. If not see #include "splay-tree.h" #include "params.h" -/* This needs to be included after config.h. Otherwise, _GNU_SOURCE will not - be defined in time to set __USE_GNU in the system headers, and strsignal - will not be declared. */ -#if HAVE_MMAP_FILE -#include <sys/mman.h> -#endif - -/* Handle opening elf files on hosts, such as Windows, that may use - text file handling that will break binary access. */ - -#ifndef O_BINARY -# define O_BINARY 0 -#endif - static GTY(()) tree first_personality_decl; /* Returns a hash code for P. */ diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c index 1475e9599db..3dfb8ae0a2d 100644 --- a/gcc/mips-tfile.c +++ b/gcc/mips-tfile.c @@ -665,8 +665,6 @@ main (void) #undef index -#include <signal.h> - #ifndef CROSS_DIRECTORY_STRUCTURE #include <a.out.h> #else diff --git a/gcc/opts.c b/gcc/opts.c index cd41c2ab317..8174d156f77 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -21,13 +21,6 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "system.h" - -#include <signal.h> - -#ifdef HAVE_SYS_RESOURCE_H -# include <sys/resource.h> -#endif - #include "intl.h" #include "coretypes.h" #include "tm.h" /* Needed by rtl.h and used for DWARF2_DEBUGGING_INFO @@ -1128,7 +1121,7 @@ print_specific_help (unsigned int include_flags, { const char *p; - GET_ENVIRONMENT (p, "COLUMNS"); + p = getenv ("COLUMNS"); if (p != NULL) { int value = atoi (p); diff --git a/gcc/passes.c b/gcc/passes.c index 38cc570a39d..4be61a9455e 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -28,16 +28,6 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tm.h" -#include <signal.h> - -#ifdef HAVE_SYS_RESOURCE_H -# include <sys/resource.h> -#endif - -#ifdef HAVE_SYS_TIMES_H -# include <sys/times.h> -#endif - #include "line-map.h" #include "input.h" #include "tree.h" diff --git a/gcc/sparseset.h b/gcc/sparseset.h index 3554ef6b35c..c177d2d456d 100644 --- a/gcc/sparseset.h +++ b/gcc/sparseset.h @@ -1,5 +1,5 @@ /* SparseSet implementation. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007, 2010 Free Software Foundation, Inc. Contributed by Peter Bergner <bergner@vnet.ibm.com> This file is part of GCC. @@ -21,8 +21,6 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_SPARSESET_H #define GCC_SPARSESET_H -#include <assert.h> - #define SPARSESET_ELT_BITS ((unsigned) HOST_BITS_PER_WIDEST_FAST_INT) #define SPARSESET_ELT_TYPE unsigned int diff --git a/gcc/system.h b/gcc/system.h index 41e865744e9..3dc3b4e8d88 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -180,7 +180,7 @@ extern int fprintf_unlocked (FILE *, const char *, ...); /* There are an extraordinary number of issues with <ctype.h>. The last straw is that it varies with the locale. Use libiberty's replacement instead. */ -#include <safe-ctype.h> +#include "safe-ctype.h" #include <sys/types.h> @@ -314,6 +314,9 @@ extern int errno; #ifndef O_WRONLY # define O_WRONLY 1 #endif +#ifndef O_BINARY +# define O_BINARY 0 +#endif /* Some systems define these in, e.g., param.h. We undefine these names here to avoid the warnings. We prefer to use our definitions since we @@ -353,6 +356,31 @@ extern int errno; #define WCOREFLG 0200 #endif +#include <signal.h> +#if !defined (SIGCHLD) && defined (SIGCLD) +# define SIGCHLD SIGCLD +#endif + +#ifdef HAVE_SYS_MMAN_H +# include <sys/mman.h> +#endif + +#ifndef MAP_FAILED +# define MAP_FAILED ((void *)-1) +#endif + +#if !defined (MAP_ANONYMOUS) && defined (MAP_ANON) +# define MAP_ANONYMOUS MAP_ANON +#endif + +#ifdef HAVE_SYS_RESOURCE_H +# include <sys/resource.h> +#endif + +#ifdef HAVE_SYS_TIMES_H +# include <sys/times.h> +#endif + /* The HAVE_DECL_* macros are three-state, undefined, 0 or 1. If they are defined to 0 then we must provide the relevant declaration here. These checks will be in the undefined state while configure @@ -526,6 +554,10 @@ extern int vsnprintf(char *, size_t, const char *, va_list); # define mkdir(a,b) mkdir(a) #endif +#ifndef HAVE_KILL +# define kill(p,s) raise(s) +#endif + /* Provide a way to print an address via printf. */ #ifndef HOST_PTR_PRINTF #define HOST_PTR_PRINTF "%p" @@ -804,7 +836,7 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; LIBGCC2_FLOAT_WORDS_BIG_ENDIAN /* Miscellaneous macros that are no longer used. */ - #pragma GCC poison USE_MAPPED_LOCATION + #pragma GCC poison USE_MAPPED_LOCATION GET_ENVIRONMENT /* Libiberty macros that are no longer used in GCC. */ #undef ANSI_PROTOTYPES diff --git a/gcc/timevar.c b/gcc/timevar.c index df671e4c27c..f1d20e8d0c5 100644 --- a/gcc/timevar.c +++ b/gcc/timevar.c @@ -1,5 +1,6 @@ /* Timing variables for measuring compiler performance. - Copyright (C) 2000, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2000, 2003, 2004, 2005, 2007, 2010 + Free Software Foundation, Inc. Contributed by Alex Samuel <samuel@codesourcery.com> This file is part of GCC. @@ -20,12 +21,6 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "system.h" -#ifdef HAVE_SYS_TIMES_H -# include <sys/times.h> -#endif -#ifdef HAVE_SYS_RESOURCE_H -#include <sys/resource.h> -#endif #include "timevar.h" #ifndef HAVE_CLOCK_T diff --git a/gcc/tlink.c b/gcc/tlink.c index 7b589832b06..44618ed40df 100644 --- a/gcc/tlink.c +++ b/gcc/tlink.c @@ -1,8 +1,8 @@ /* Scan linker error messages for missing template instantiations and provide them. - Copyright (C) 1995, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008 - Free Software Foundation, Inc. + Copyright (C) 1995, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008, + 2009, 2010 Free Software Foundation, Inc. Contributed by Jason Merrill (jason@cygnus.com). This file is part of GCC. @@ -30,7 +30,6 @@ along with GCC; see the file COPYING3. If not see #include "hashtab.h" #include "demangle.h" #include "collect2.h" -#include "libiberty.h" /* TARGET_64BIT may be defined to use driver specific functionality. */ #undef TARGET_64BIT diff --git a/gcc/toplev.c b/gcc/toplev.c index 1bfdbe22986..37114ceb550 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -28,12 +28,6 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tm.h" -#include <signal.h> - -#ifdef HAVE_SYS_TIMES_H -# include <sys/times.h> -#endif - #include "line-map.h" #include "input.h" #include "tree.h" diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c index f65d1dab562..a85733bb3b7 100644 --- a/gcc/tree-mudflap.c +++ b/gcc/tree-mudflap.c @@ -39,7 +39,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-pass.h" #include "hashtab.h" #include "diagnostic.h" -#include <demangle.h> +#include "demangle.h" #include "langhooks.h" #include "ggc.h" #include "cgraph.h" diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c index fc333f7480d..0f4b429c314 100644 --- a/gcc/tree-switch-conversion.c +++ b/gcc/tree-switch-conversion.c @@ -80,8 +80,6 @@ eight) times the number of the actual switch branches. */ #include "system.h" #include "coretypes.h" #include "tm.h" -#include <signal.h> - #include "line-map.h" #include "params.h" #include "flags.h" diff --git a/gcc/vmsdbgout.c b/gcc/vmsdbgout.c index 45da4419722..2278d1ab30d 100644 --- a/gcc/vmsdbgout.c +++ b/gcc/vmsdbgout.c @@ -1625,9 +1625,7 @@ vmsdbgout_finish (const char *main_input_filename ATTRIBUTE_UNUSED) #include <vms/stsdef.h> #include <vms/iodef.h> #include <vms/fatdef.h> -#include <errno.h> #include <vms/descrip.h> -#include <string.h> #include <unixlib.h> #define MAXPATH 256 |