aboutsummaryrefslogtreecommitdiffstats
path: root/tempfile.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2007-01-12 03:05:28 +0000
committerUlf Lamping <ulf.lamping@web.de>2007-01-12 03:05:28 +0000
commit2cbce84d411dcd9e00c91db246a01947ac2f4a69 (patch)
tree7258f1ecfd45f0c00809ca4fd05377f799dec282 /tempfile.c
parentba4a3277045ee81999188cd18a72fe25e361ea35 (diff)
Win32: MSVC > 6 doesn't work well with Unicode filenames!
fix this, by providing required functions in the new file file_util.c - it's mostly copied from GLib (g_open alike - that take UTF8 as filename format but don't use msvcrt.dll V6 for this as the glib files do) "link" to these functions in file_util.h: #define eth_open eth_stdio_open revert changes (from SVN 20282) throughout the code related to these file functions which were introduced with the first tries of MSVC 2005 ... Hopefully I've done everything right with the new file_util.c ... svn path=/trunk/; revision=20402
Diffstat (limited to 'tempfile.c')
-rw-r--r--tempfile.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/tempfile.c b/tempfile.c
index 971f6d5b0e..61495281ce 100644
--- a/tempfile.c
+++ b/tempfile.c
@@ -39,20 +39,12 @@
#include "file_util.h"
-#if (GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 6)) && (!defined _MSC_VER || _MSC_VER < 1300)
-#include <glib/gstdio.h> /* available since GLib 2.6 only! */
-
-/* GLib2.6 or above, using new wrapper functions */
-#define eth_mkstemp g_mkstemp
-#else
-#define eth_mkstemp mkstemp
-#endif
-
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
#include "tempfile.h"
+#include "mkstemp.h"
static const char *
setup_tmpdir(const char *dir)
@@ -99,7 +91,7 @@ try_tempfile(char *namebuf, int namebuflen, const char *dir, const char *pfx)
permissions, attempt to create the file, and then put
the umask back. */
old_umask = umask(0077);
- tmp_fd = eth_mkstemp(namebuf);
+ tmp_fd = mkstemp(namebuf);
umask(old_umask);
return tmp_fd;
}