xalloc.h now uses inline, so includers need to configure this.
[gnulib.git] / lib / error.c
index 1c74a14..1149235 100644 (file)
@@ -90,9 +90,9 @@ extern void __error_at_line (int status, int errnum, const char *file_name,
 char *strerror_r ();
 # endif
 
-#ifndef SIZE_MAX
-# define SIZE_MAX ((size_t) -1)
-#endif
+# ifndef SIZE_MAX
+#  define SIZE_MAX ((size_t) -1)
+# endif
 
 /* The calling program should define program_name and set it to the
    name of the executing program.  */
@@ -147,19 +147,18 @@ error_tail (int status, int errnum, const char *message, va_list args)
 # define ALLOCA_LIMIT 2000
       size_t len = strlen (message) + 1;
       const wchar_t *wmessage = L"out of memory";
-      mbstate_t st;
-      size_t res;
-      const char *tmp;
       wchar_t *wbuf = (len < ALLOCA_LIMIT
-                      ? (void *) alloca (len * sizeof *wbuf)
+                      ? alloca (len * sizeof *wbuf)
                       : len <= SIZE_MAX / sizeof *wbuf
                       ? malloc (len * sizeof *wbuf)
                       : NULL);
 
       if (wbuf)
        {
+         size_t res;
+         mbstate_t st;
+         const char *tmp = message;
          memset (&st, '\0', sizeof (st));
-         tmp =message;
          res = mbsrtowcs (wbuf, &tmp, len, &st);
          wmessage = res == (size_t) -1 ? L"???" : wbuf;
        }