#include <setjmp.h>
#include <signal.h>
+#if ! defined( SIGCHLD ) && defined( SIGCLD )
+# define SIGCHLD SIGCLD
+#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
/* Macro to see if the path elements match. */
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
-#define IS_SAME_PATH_CHAR(a,b) (toupper (a) == toupper (b))
+#define IS_SAME_PATH_CHAR(a,b) (TOUPPER (a) == TOUPPER (b))
#else
#define IS_SAME_PATH_CHAR(a,b) ((a) == (b))
#endif
static const char * const other_var_style = "varargs";
/* Note that this is a string containing the expansion of va_alist.
But in `main' we discard all but the first token. */
-static const char *varargs_style_indicator = STRINGIFY (va_alist);
+static const char *varargs_style_indicator = STRINGX (va_alist);
#endif /* !defined (UNPROTOIZE) */
/* The following two types are used to create hash tables. In this program,
= (const char **) alloca ((strlen (params_list) + 8) * sizeof (char *));
int param_count = 0;
const char *param;
+ struct stat st;
temp_params[param_count++] = compiler_file_name;
for (;;)
temp_params[param_count++] = "-S";
temp_params[param_count++] = "-o";
-#if defined (_WIN32) && ! defined (__CYGWIN__) && ! defined (_UWIN)
- temp_params[param_count++] = "NUL";
-#else
- temp_params[param_count++] = "/dev/null";
-#endif
+
+ if ((stat (HOST_BIT_BUCKET, &st) == 0)
+ && (!S_ISDIR (st.st_mode))
+ && (access (HOST_BIT_BUCKET, W_OK) == 0))
+ temp_params[param_count++] = HOST_BIT_BUCKET;
+ else
+ /* FIXME: This is hardly likely to be right, if HOST_BIT_BUCKET is not
+ writable. But until this is rejigged to use make_temp_file(), this
+ is the best we can do. */
+ temp_params[param_count++] = "/dev/null";
/* Leave room for the input file name argument. */
input_file_name_index = param_count;
#endif
pname = pname ? pname+1 : argv[0];
+#ifdef SIGCHLD
+ /* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will
+ receive the signal. A different setting is inheritable */
+ signal (SIGCHLD, SIG_DFL);
+#endif
+
+/* LC_CTYPE determines the character set used by the terminal so it has be set
+ to output messages correctly. */
+
#ifdef HAVE_LC_MESSAGES
+ setlocale (LC_CTYPE, "");
setlocale (LC_MESSAGES, "");
+#else
+ setlocale (LC_ALL, "");
#endif
+
(void) bindtextdomain (PACKAGE, localedir);
(void) textdomain (PACKAGE);