From f16449b777f8405538f6aa75a6ce059e51bb5936 Mon Sep 17 00:00:00 2001 From: neil Date: Sun, 21 Jul 2002 21:59:03 +0000 Subject: [PATCH] * c-lex.c (GET_ENVIRONMENT): Remove. * collect2.c (GET_ENV_PATH_LIST): Remove. (prefix_from_env): Use GET_ENVIRONMENT. * cppinit.c (GET_ENV_PATH_LIST): Remove. (init_standard_includes): Use GET_ENVIRONMENT. * defaults.h (GET_ENVIRONMENT): Define here if not already. * gcc.c (GET_ENV_PATH_LIST): Remove. (make_relative_prefix, process_command): Update. * protoize.c (GET_ENV_PATH_LIST): Remove. (do_processing): Update. java: * jcf-path.c (GET_ENV_PATH_LIST): Remove. (jcf_path_init): Use GET_ENVIRONMENT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55630 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 13 +++++++++++++ gcc/c-lex.c | 3 --- gcc/collect2.c | 6 +----- gcc/cppinit.c | 16 +++++----------- gcc/defaults.h | 4 ++++ gcc/gcc.c | 14 +++++--------- gcc/java/ChangeLog | 5 +++++ gcc/java/jcf-path.c | 10 ++-------- gcc/protoize.c | 6 +----- 9 files changed, 36 insertions(+), 41 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index efb6658..29dad05 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2002-07-21 Neil Booth + + * c-lex.c (GET_ENVIRONMENT): Remove. + * collect2.c (GET_ENV_PATH_LIST): Remove. + (prefix_from_env): Use GET_ENVIRONMENT. + * cppinit.c (GET_ENV_PATH_LIST): Remove. + (init_standard_includes): Use GET_ENVIRONMENT. + * defaults.h (GET_ENVIRONMENT): Define here if not already. + * gcc.c (GET_ENV_PATH_LIST): Remove. + (make_relative_prefix, process_command): Update. + * protoize.c (GET_ENV_PATH_LIST): Remove. + (do_processing): Update. + 2002-07-21 Gabriel Dos Reis * c-decl.c (build_array_declarator): Say 'ISO C90', not 'ISO C89'. diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 4a7f05a..bf5c424 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -44,9 +44,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "mbchar.h" #include #endif /* MULTIBYTE_CHARS */ -#ifndef GET_ENVIRONMENT -#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ((ENV_VALUE) = getenv (ENV_NAME)) -#endif /* The current line map. */ static const struct line_map *map; diff --git a/gcc/collect2.c b/gcc/collect2.c index 97f1597..537c076 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -246,10 +246,6 @@ int pexecute_pid; /* Defined in the automatically-generated underscore.c. */ extern int prepends_underscore; -#ifndef GET_ENV_PATH_LIST -#define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0) -#endif - /* Structure to hold all the directories in which to search for files to execute. */ @@ -753,7 +749,7 @@ prefix_from_env (env, pprefix) struct path_prefix *pprefix; { const char *p; - GET_ENV_PATH_LIST (p, env); + GET_ENVIRONMENT (p, env); if (p) prefix_from_string (p, pprefix); diff --git a/gcc/cppinit.c b/gcc/cppinit.c index 72e26ce..a6be4aa 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -29,12 +29,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "mkdeps.h" #include "cppdefault.h" -/* Predefined symbols, built-in macros, and the default include path. */ - -#ifndef GET_ENV_PATH_LIST -#define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0) -#endif - /* Windows does not natively support inodes, and neither does MSDOS. Cygwin's emulation can generate non-unique inodes, so don't use it. VMS has non-numeric inodes. */ @@ -729,23 +723,23 @@ init_standard_includes (pfile) etc. specify an additional list of directories to be searched as if specified with -isystem, for the language indicated. */ - GET_ENV_PATH_LIST (path, "CPATH"); + GET_ENVIRONMENT (path, "CPATH"); if (path != 0 && *path != 0) path_include (pfile, path, BRACKET); switch ((CPP_OPTION (pfile, objc) << 1) + CPP_OPTION (pfile, cplusplus)) { case 0: - GET_ENV_PATH_LIST (path, "C_INCLUDE_PATH"); + GET_ENVIRONMENT (path, "C_INCLUDE_PATH"); break; case 1: - GET_ENV_PATH_LIST (path, "CPLUS_INCLUDE_PATH"); + GET_ENVIRONMENT (path, "CPLUS_INCLUDE_PATH"); break; case 2: - GET_ENV_PATH_LIST (path, "OBJC_INCLUDE_PATH"); + GET_ENVIRONMENT (path, "OBJC_INCLUDE_PATH"); break; case 3: - GET_ENV_PATH_LIST (path, "OBJCPLUS_INCLUDE_PATH"); + GET_ENVIRONMENT (path, "OBJCPLUS_INCLUDE_PATH"); break; } if (path != 0 && *path != 0) diff --git a/gcc/defaults.h b/gcc/defaults.h index 5b88ac2..b542e53 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -23,6 +23,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifndef GCC_DEFAULTS_H #define GCC_DEFAULTS_H +#ifndef GET_ENVIRONMENT +#define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0) +#endif + /* Define default standard character escape sequences. */ #ifndef TARGET_BELL # define TARGET_BELL 007 diff --git a/gcc/gcc.c b/gcc/gcc.c index 0682c48ad..73ae198 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -125,10 +125,6 @@ static const char dir_separator_str[] = { DIR_SEPARATOR, 0 }; #define obstack_chunk_alloc xmalloc #define obstack_chunk_free free -#ifndef GET_ENV_PATH_LIST -#define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0) -#endif - /* Most every one is fine with LIBRARY_PATH. For some, it conflicts. */ #ifndef LIBRARY_PATH_ENV #define LIBRARY_PATH_ENV "LIBRARY_PATH" @@ -2352,7 +2348,7 @@ make_relative_prefix (progname, bin_prefix, prefix) { char *temp; - GET_ENV_PATH_LIST (temp, "PATH"); + GET_ENVIRONMENT (temp, "PATH"); if (temp) { char *startp, *endp, *nstore; @@ -3169,7 +3165,7 @@ process_command (argc, argv) int j; #endif - GET_ENV_PATH_LIST (gcc_exec_prefix, "GCC_EXEC_PREFIX"); + GET_ENVIRONMENT (gcc_exec_prefix, "GCC_EXEC_PREFIX"); n_switches = 0; n_infiles = 0; @@ -3282,7 +3278,7 @@ process_command (argc, argv) /* COMPILER_PATH and LIBRARY_PATH have values that are lists of directory names with colons. */ - GET_ENV_PATH_LIST (temp, "COMPILER_PATH"); + GET_ENVIRONMENT (temp, "COMPILER_PATH"); if (temp) { const char *startp, *endp; @@ -3317,7 +3313,7 @@ process_command (argc, argv) } } - GET_ENV_PATH_LIST (temp, LIBRARY_PATH_ENV); + GET_ENVIRONMENT (temp, LIBRARY_PATH_ENV); if (temp && *cross_compile == '0') { const char *startp, *endp; @@ -3350,7 +3346,7 @@ process_command (argc, argv) } /* Use LPATH like LIBRARY_PATH (for the CMU build program). */ - GET_ENV_PATH_LIST (temp, "LPATH"); + GET_ENVIRONMENT (temp, "LPATH"); if (temp && *cross_compile == '0') { const char *startp, *endp; diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 0bbdcb9..601e766 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2002-07-21 Neil Booth + + * jcf-path.c (GET_ENV_PATH_LIST): Remove. + (jcf_path_init): Use GET_ENVIRONMENT. + 2002-07-10 Roger Sayle Zack Weinberg diff --git a/gcc/java/jcf-path.c b/gcc/java/jcf-path.c index b68a538..ce05088 100644 --- a/gcc/java/jcf-path.c +++ b/gcc/java/jcf-path.c @@ -30,12 +30,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "jcf.h" -/* Some boilerplate that really belongs in a header. */ - -#ifndef GET_ENV_PATH_LIST -#define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0) -#endif - /* By default, colon separates directories in a path. */ #ifndef PATH_SEPARATOR #define PATH_SEPARATOR ':' @@ -244,7 +238,7 @@ jcf_path_init () sep[0] = DIR_SEPARATOR; sep[1] = '\0'; - GET_ENV_PATH_LIST (cp, "GCC_EXEC_PREFIX"); + GET_ENVIRONMENT (cp, "GCC_EXEC_PREFIX"); if (cp) { try = alloca (strlen (cp) + 50); @@ -315,7 +309,7 @@ jcf_path_init () jcf_path_extdirs_arg (extdirs); } - GET_ENV_PATH_LIST (cp, "CLASSPATH"); + GET_ENVIRONMENT (cp, "CLASSPATH"); add_path (&classpath_env, cp, 0); } diff --git a/gcc/protoize.c b/gcc/protoize.c index 98179bc..61d583c 100644 --- a/gcc/protoize.c +++ b/gcc/protoize.c @@ -128,10 +128,6 @@ static const char * const standard_exec_prefix = STANDARD_EXEC_PREFIX; static const char * const target_machine = DEFAULT_TARGET_MACHINE; static const char * const target_version = DEFAULT_TARGET_VERSION; -#ifndef GET_ENV_PATH_LIST -#define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0) -#endif - #endif /* !defined (UNPROTOIZE) */ /* Suffix of aux_info files. */ @@ -4415,7 +4411,7 @@ do_processing () } else { - GET_ENV_PATH_LIST (default_syscalls_dir, "GCC_EXEC_PREFIX"); + GET_ENVIRONMENT (default_syscalls_dir, "GCC_EXEC_PREFIX"); if (!default_syscalls_dir) { default_syscalls_dir = standard_exec_prefix; -- 2.7.4