From 71f3e391b3fdd791965321747ac078a61472fb87 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 29 Nov 2010 14:09:41 +0000 Subject: system.h: Include "safe-ctype.h" instead of . * system.h: Include "safe-ctype.h" instead of . Include , , and . (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 . * collect2.c: Don't include . (SIGCHLD): Don't define. (prefix_from_env): Use getenv instead of GET_ENVIRONMENT. * config/alpha/alpha.c: Include "splay-tree.h" instead of . * config/arm/arm.c (arm_target_help): Use getenv instead of GET_ENVIRONMENT. * config/avr/driver-avr.c: Don't include . * config/frv/frv.c: Don't include . * config/host-darwin.c: Don't include . * config/host-hpux.c: Don't include or . (MAP_FAILED): Don't define. * config/host-linux.c: Don't include or . * config/host-solaris.c: Don't include . * config/i386/cygming.h: Don't include . * config/i386/driver-i386.c: Don't include . * config/i386/host-cygwin.c: Don't include . * config/iq2000/iq2000.c: Don't include . * config/m32c/m32c-pragma.c: Don't include . * config/m68hc11/m68hc11.c: Don't include . * config/mep/mep-pragma.c: Don't include . * config/microblaze/microblaze.c: Don't include . * config/mips/mips.c: Don't include . * config/rs6000/host-darwin.c: Don't include . * cppdefault.c (cpp_relocated): Use getenv instead of GET_ENVIRONMENT. * defaults.h (GET_ENVIRONMENT): Don't define. * et-forest.h: Don't include or . * gcc.c: Don't include , or . (SIGCHLD, MAP_FAILED, kill): Don't define. (process_command): Use getenv instead of GET_ENVIRONMENT. * genhooks.c: Don't include . * ggc-common.c: Don't include , or . (MAP_FAILED): Don't define. * ggc-page.c Don't include . (MAP_ANONYMOUS, MAP_FAILED): Don't define. * ggc-zone.c: Don't include . (MAP_ANONYMOUS, MAP_FAILED): Don't define. * graph.c: Include "config.h" instead of . * incpath.c (add_env_var_paths): Use getenv instead of GET_ENVIRONMENT. * lto-wrapper.c: Don't include , or "libiberty.h". (SIGCHLD, kill): Don't define. * mips-tfile.c: Don't include . * opts.c: Don't include or . (print_specific_help): Use getenv instead of GET_ENVIRONMENT. * passes.c: Don't include , or . * sparseset.h: Don't include . * timevar.c: Don't include or . * tlink.c: Don't include "libiberty.h". * toplev.c: Don't include or . * tree-mudflap.c: Include "demangle.h" instead of . * tree-switch-conversion.c: Don't include . * vmsdbgout.c: Don't include or . c-family: * 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 . fortran: * gfortran.h (alloca): Don't include definitions. (NULL): Don't define. java: * boehm.c: Include "config.h" instead of . * builtins.c: Don't include . * class.c: Don't include "stdio.h". (O_BINARY): Don't define here. * jcf-depend.c: Don't include . (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 . lto: * 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 . (O_BINARY): Don't define. From-SVN: r167241 --- gcc/system.h | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'gcc/system.h') diff --git a/gcc/system.h b/gcc/system.h index 41e8657..3dc3b4e 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 . The last straw is that it varies with the locale. Use libiberty's replacement instead. */ -#include +#include "safe-ctype.h" #include @@ -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 +#if !defined (SIGCHLD) && defined (SIGCLD) +# define SIGCHLD SIGCLD +#endif + +#ifdef HAVE_SYS_MMAN_H +# include +#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 +#endif + +#ifdef HAVE_SYS_TIMES_H +# include +#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 -- cgit v1.1