Commit b2a1e458 by Felix Lee Committed by Jeff Law

c-lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT ().

        * c-lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT ().
        * cccp.c (main): Likewise.
        * gcc.c (process_command): Similarly for "GCC_EXEC_PREFIX".
        * cccp.c, collect2.c, cpplib.c, gcc.c, config/i386/xm-cygwin32.h:
        Rename GET_ENVIRONMENT to GET_ENV_PATH_LIST, and fix some
        macro-use bugs.

From-SVN: r22511
parent 717f76d8
Mon Sep 21 01:53:05 1998 Felix Lee <flee@cygnus.com>
* c-lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT ().
* cccp.c (main): Likewise.
* gcc.c (process_command): Similarly for "GCC_EXEC_PREFIX".
* cccp.c, collect2.c, cpplib.c, gcc.c, config/i386/xm-cygwin32.h:
Rename GET_ENVIRONMENT to GET_ENV_PATH_LIST, and fix some
macro-use bugs.
Mon Sep 21 00:52:12 1998 Per Bothner <bothner@cygnus.com> Mon Sep 21 00:52:12 1998 Per Bothner <bothner@cygnus.com>
* Makefile.in (LIBS): Link in libiberty.a. * Makefile.in (LIBS): Link in libiberty.a.
......
...@@ -36,10 +36,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -36,10 +36,6 @@ Boston, MA 02111-1307, USA. */
#ifdef MULTIBYTE_CHARS #ifdef MULTIBYTE_CHARS
#include "mbchar.h" #include "mbchar.h"
#include <locale.h> #include <locale.h>
#ifndef GET_ENVIRONMENT
#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ((ENV_VALUE) = getenv (ENV_NAME))
#endif
#endif /* MULTIBYTE_CHARS */ #endif /* MULTIBYTE_CHARS */
#if USE_CPPLIB #if USE_CPPLIB
...@@ -230,7 +226,7 @@ init_lex () ...@@ -230,7 +226,7 @@ init_lex ()
#ifdef MULTIBYTE_CHARS #ifdef MULTIBYTE_CHARS
/* Change to the native locale for multibyte conversions. */ /* Change to the native locale for multibyte conversions. */
setlocale (LC_CTYPE, ""); setlocale (LC_CTYPE, "");
GET_ENVIRONMENT (literal_codeset, "LANG"); literal_codeset = getenv ("LANG");
#endif #endif
maxtoken = 40; maxtoken = 40;
......
...@@ -45,8 +45,8 @@ typedef unsigned char U_CHAR; ...@@ -45,8 +45,8 @@ typedef unsigned char U_CHAR;
#include <locale.h> #include <locale.h>
#endif /* MULTIBYTE_CHARS */ #endif /* MULTIBYTE_CHARS */
#ifndef GET_ENVIRONMENT #ifndef GET_ENV_PATH_LIST
#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ENV_VALUE = getenv (ENV_NAME) #define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0)
#endif #endif
#ifndef STANDARD_INCLUDE_DIR #ifndef STANDARD_INCLUDE_DIR
...@@ -1310,7 +1310,7 @@ main (argc, argv) ...@@ -1310,7 +1310,7 @@ main (argc, argv)
#ifdef MULTIBYTE_CHARS #ifdef MULTIBYTE_CHARS
/* Change to the native locale for multibyte conversions. */ /* Change to the native locale for multibyte conversions. */
setlocale (LC_CTYPE, ""); setlocale (LC_CTYPE, "");
GET_ENVIRONMENT (literal_codeset, "LANG"); literal_codeset = getenv ("LANG");
#endif #endif
/* Process switches and find input file name. */ /* Process switches and find input file name. */
...@@ -1742,7 +1742,7 @@ main (argc, argv) ...@@ -1742,7 +1742,7 @@ main (argc, argv)
/* Some people say that CPATH should replace the standard include dirs, /* Some people say that CPATH should replace the standard include dirs,
but that seems pointless: it comes before them, so it overrides them but that seems pointless: it comes before them, so it overrides them
anyway. */ anyway. */
GET_ENVIRONMENT (cp, "CPATH"); GET_ENV_PATH_LIST (cp, "CPATH");
if (cp && ! no_standard_includes) if (cp && ! no_standard_includes)
path_include (cp); path_include (cp);
...@@ -1926,16 +1926,16 @@ main (argc, argv) ...@@ -1926,16 +1926,16 @@ main (argc, argv)
switch ((objc << 1) + cplusplus) switch ((objc << 1) + cplusplus)
{ {
case 0: case 0:
GET_ENVIRONMENT (epath, "C_INCLUDE_PATH"); GET_ENV_PATH_LIST (epath, "C_INCLUDE_PATH");
break; break;
case 1: case 1:
GET_ENVIRONMENT (epath, "CPLUS_INCLUDE_PATH"); GET_ENV_PATH_LIST (epath, "CPLUS_INCLUDE_PATH");
break; break;
case 2: case 2:
GET_ENVIRONMENT (epath, "OBJC_INCLUDE_PATH"); GET_ENV_PATH_LIST (epath, "OBJC_INCLUDE_PATH");
break; break;
case 3: case 3:
GET_ENVIRONMENT (epath, "OBJCPLUS_INCLUDE_PATH"); GET_ENV_PATH_LIST (epath, "OBJCPLUS_INCLUDE_PATH");
break; break;
} }
/* If the environment var for this language is set, /* If the environment var for this language is set,
......
...@@ -233,8 +233,8 @@ extern int prepends_underscore; ...@@ -233,8 +233,8 @@ extern int prepends_underscore;
extern FILE *fdopen (); extern FILE *fdopen ();
#ifndef GET_ENVIRONMENT #ifndef GET_ENV_PATH_LIST
#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ENV_VALUE = getenv (ENV_NAME) #define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0)
#endif #endif
/* Structure to hold all the directories in which to search for files to /* Structure to hold all the directories in which to search for files to
...@@ -862,7 +862,7 @@ prefix_from_env (env, pprefix) ...@@ -862,7 +862,7 @@ prefix_from_env (env, pprefix)
struct path_prefix *pprefix; struct path_prefix *pprefix;
{ {
char *p; char *p;
GET_ENVIRONMENT (p, env); GET_ENV_PATH_LIST (p, env);
if (p) if (p)
prefix_from_string (p, pprefix); prefix_from_string (p, pprefix);
......
...@@ -32,22 +32,22 @@ Boston, MA 02111-1307, USA. */ ...@@ -32,22 +32,22 @@ Boston, MA 02111-1307, USA. */
/* If we allow both '/' and '\' as dir separators, then /* If we allow both '/' and '\' as dir separators, then
allow both unix and win32 PATH syntax */ allow both unix and win32 PATH syntax */
#undef GET_ENVIRONMENT #undef GET_ENV_PATH_LIST
#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) \ #define GET_ENV_PATH_LIST(VAR,NAME) \
{ \ do { \
char *epath; \ char *_epath; \
char *win32epath; \ char *_win32epath; \
\ _epath = _win32epath = getenv (NAME); \
epath = win32epath = getenv (ENV_NAME); \
/* if we have a posix path list, convert to win32 path list */ \ /* if we have a posix path list, convert to win32 path list */ \
if (epath != NULL && *epath != 0 && cygwin32_posix_path_list_p (epath)) \ if (_epath != NULL && *_epath != 0 \
&& cygwin32_posix_path_list_p (_epath)) \
{ \ { \
win32epath = (char *) xmalloc \ _win32epath = (char *) xmalloc \
(cygwin32_posix_to_win32_path_list_buf_size (epath)); \ (cygwin32_posix_to_win32_path_list_buf_size (_epath)); \
cygwin32_posix_to_win32_path_list (epath, win32epath); \ cygwin32_posix_to_win32_path_list (_epath, _win32epath); \
} \ } \
ENV_VALUE = win32epath; \ (VAR) = _win32epath; \
} } while (0)
#define PATH_SEPARATOR ';' #define PATH_SEPARATOR ';'
......
...@@ -39,8 +39,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ...@@ -39,8 +39,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "cpplib.h" #include "cpplib.h"
#include "cpphash.h" #include "cpphash.h"
#ifndef GET_ENVIRONMENT #ifndef GET_ENV_PATH_LIST
#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ENV_VALUE = getenv (ENV_NAME) #define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0)
#endif #endif
extern char *update_path PARAMS ((char *, char *)); extern char *update_path PARAMS ((char *, char *));
...@@ -5710,7 +5710,7 @@ cpp_start_read (pfile, fname) ...@@ -5710,7 +5710,7 @@ cpp_start_read (pfile, fname)
/* Some people say that CPATH should replace the standard include dirs, /* Some people say that CPATH should replace the standard include dirs,
but that seems pointless: it comes before them, so it overrides them but that seems pointless: it comes before them, so it overrides them
anyway. */ anyway. */
GET_ENVIRONMENT (p, "CPATH"); GET_ENV_PATH_LIST (p, "CPATH");
if (p != 0 && ! opts->no_standard_includes) if (p != 0 && ! opts->no_standard_includes)
path_include (pfile, p); path_include (pfile, p);
...@@ -5840,16 +5840,16 @@ cpp_start_read (pfile, fname) ...@@ -5840,16 +5840,16 @@ cpp_start_read (pfile, fname)
switch ((opts->objc << 1) + opts->cplusplus) switch ((opts->objc << 1) + opts->cplusplus)
{ {
case 0: case 0:
GET_ENVIRONMENT (epath, "C_INCLUDE_PATH"); GET_ENV_PATH_LIST (epath, "C_INCLUDE_PATH");
break; break;
case 1: case 1:
GET_ENVIRONMENT (epath, "CPLUS_INCLUDE_PATH"); GET_ENV_PATH_LIST (epath, "CPLUS_INCLUDE_PATH");
break; break;
case 2: case 2:
GET_ENVIRONMENT (epath, "OBJC_INCLUDE_PATH"); GET_ENV_PATH_LIST (epath, "OBJC_INCLUDE_PATH");
break; break;
case 3: case 3:
GET_ENVIRONMENT (epath, "OBJCPLUS_INCLUDE_PATH"); GET_ENV_PATH_LIST (epath, "OBJCPLUS_INCLUDE_PATH");
break; break;
} }
/* If the environment var for this language is set, /* If the environment var for this language is set,
......
...@@ -111,8 +111,8 @@ static char dir_separator_str[] = {DIR_SEPARATOR, 0}; ...@@ -111,8 +111,8 @@ static char dir_separator_str[] = {DIR_SEPARATOR, 0};
#define obstack_chunk_alloc xmalloc #define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free #define obstack_chunk_free free
#ifndef GET_ENVIRONMENT #ifndef GET_ENV_PATH_LIST
#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ENV_VALUE = getenv (ENV_NAME) #define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0)
#endif #endif
extern char *my_strerror PROTO((int)); extern char *my_strerror PROTO((int));
...@@ -2563,7 +2563,7 @@ process_command (argc, argv) ...@@ -2563,7 +2563,7 @@ process_command (argc, argv)
int have_o = 0; int have_o = 0;
int lang_n_infiles = 0; int lang_n_infiles = 0;
GET_ENVIRONMENT (gcc_exec_prefix, "GCC_EXEC_PREFIX"); gcc_exec_prefix = getenv ("GCC_EXEC_PREFIX");
n_switches = 0; n_switches = 0;
n_infiles = 0; n_infiles = 0;
...@@ -2606,7 +2606,7 @@ process_command (argc, argv) ...@@ -2606,7 +2606,7 @@ process_command (argc, argv)
/* COMPILER_PATH and LIBRARY_PATH have values /* COMPILER_PATH and LIBRARY_PATH have values
that are lists of directory names with colons. */ that are lists of directory names with colons. */
GET_ENVIRONMENT (temp, "COMPILER_PATH"); GET_ENV_PATH_LIST (temp, "COMPILER_PATH");
if (temp) if (temp)
{ {
char *startp, *endp; char *startp, *endp;
...@@ -2640,7 +2640,7 @@ process_command (argc, argv) ...@@ -2640,7 +2640,7 @@ process_command (argc, argv)
} }
} }
GET_ENVIRONMENT (temp, "LIBRARY_PATH"); GET_ENV_PATH_LIST (temp, "LIBRARY_PATH");
if (temp && *cross_compile == '0') if (temp && *cross_compile == '0')
{ {
char *startp, *endp; char *startp, *endp;
...@@ -2673,7 +2673,7 @@ process_command (argc, argv) ...@@ -2673,7 +2673,7 @@ process_command (argc, argv)
} }
/* Use LPATH like LIBRARY_PATH (for the CMU build program). */ /* Use LPATH like LIBRARY_PATH (for the CMU build program). */
GET_ENVIRONMENT (temp, "LPATH"); GET_ENV_PATH_LIST (temp, "LPATH");
if (temp && *cross_compile == '0') if (temp && *cross_compile == '0')
{ {
char *startp, *endp; char *startp, *endp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment