X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fmake-file.c;h=78875746f24ea2ff99860c5af75825da78e60fe4;hb=2db8b20dbf5b3ab77430cc0c6a562fc17fe03e83;hp=b67ed307019b87133ec343ab1f7893f782f3f360;hpb=21ed03889d193fbcc573d5999e8e16196f3313d0;p=pspp diff --git a/src/data/make-file.c b/src/data/make-file.c index b67ed30701..78875746f2 100644 --- a/src/data/make-file.c +++ b/src/data/make-file.c @@ -45,7 +45,6 @@ #if defined _WIN32 || defined __WIN32__ #define WIN32_LEAN_AND_MEAN /* avoid including junk */ -#define UNICODE 1 #include #define TS_stat _stat #define Tunlink _wunlink @@ -149,7 +148,7 @@ Trename (TCHAR const *src, TCHAR const *dst) return -1; } -static TCHAR * +TCHAR * convert_to_filename_encoding (const char *s, size_t len, const char *current_encoding) { const char *enc = current_encoding; @@ -161,17 +160,16 @@ convert_to_filename_encoding (const char *s, size_t len, const char *current_enc #else -typedef char TCHAR; #define TS_stat stat #define Trename rename #define Tunlink unlink #define Topen open #define Tstat stat -static TCHAR * +TCHAR * convert_to_filename_encoding (const char *s, size_t len UNUSED, const char *current_encoding UNUSED) { - /* Non-windows systems don't care about the encoding. + /* Non-windows systems don't care about the encoding. The string is copied here, to be consistent with the w32 case. */ return xstrdup (s); } @@ -188,7 +186,7 @@ struct replace_file char *tmp_name_verbatim; const char *file_name_verbatim; }; - + static struct ll_list all_files = LL_INITIALIZER (all_files); static void free_replace_file (struct replace_file *); @@ -216,7 +214,7 @@ replace_file_start (const struct file_handle *fh, const char *mode, fd = Topen (Tfile_name, O_WRONLY); if (fd < 0) { - saved_errno = errno; + saved_errno = errno; msg (ME, _("Opening %s for writing: %s."), file_name, strerror (saved_errno)); free (Tfile_name); @@ -227,7 +225,7 @@ replace_file_start (const struct file_handle *fh, const char *mode, *fp = fdopen (fd, mode); if (*fp == NULL) { - saved_errno = errno; + saved_errno = errno; msg (ME, _("Opening stream for %s: %s."), file_name, strerror (saved_errno)); close (fd);