diff options
author | Eli Zaretskii <eliz@gnu.org> | 2017-08-12 11:29:37 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2017-08-12 11:29:37 +0300 |
commit | 8cc8ad02bd5c410c61680735149ce7caf67f088d (patch) | |
tree | f99ec13f9647acb1bdc89a2691943fa1802b9d33 /nt | |
parent | 84288cf4211a4490c0155d3c0022617b92294f49 (diff) | |
download | emacs-8cc8ad02bd5c410c61680735149ce7caf67f088d.tar.gz |
Use Gnulib 'tempname' on MS-Windows
* lib-src/ntlib.h (mkdir, open): Remove redefinitions. They are
now in nt/inc/ms-w32.h.
* lib-src/ntlib.c (sys_mkdir, sys_open): New functions.
(mkostemp): Remove.
* src/w32.c (mkostemp): Remove.
(sys_mkdir): Accept a second (unused) argument.
* src/fileio.c (Fmake_directory_internal): Remove the WINDOWSNT
specific call to mkdir. (Bug#28023)
* nt/inc/ms-w32.h (mkdir): Remove from "#ifdef emacs" and redefine
to accept 2 arguments.
(open): Remove from "#ifdef emacs".
* nt/mingw-cfg.site (ac_cv_func_mkostemp): Remove.
* nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_mkostemp)
(OMIT_GNULIB_MODULE_tempname): Remove.
Diffstat (limited to 'nt')
-rw-r--r-- | nt/gnulib-cfg.mk | 2 | ||||
-rw-r--r-- | nt/inc/ms-w32.h | 15 | ||||
-rw-r--r-- | nt/mingw-cfg.site | 1 |
3 files changed, 11 insertions, 7 deletions
diff --git a/nt/gnulib-cfg.mk b/nt/gnulib-cfg.mk index 175329fb9e7..d2b96f99e27 100644 --- a/nt/gnulib-cfg.mk +++ b/nt/gnulib-cfg.mk @@ -50,7 +50,6 @@ OMIT_GNULIB_MODULE_dirfd = true OMIT_GNULIB_MODULE_fcntl = true OMIT_GNULIB_MODULE_fcntl-h = true OMIT_GNULIB_MODULE_inttypes-incomplete = true -OMIT_GNULIB_MODULE_mkostemp = true OMIT_GNULIB_MODULE_pipe2 = true OMIT_GNULIB_MODULE_secure_getenv = true OMIT_GNULIB_MODULE_signal-h = true @@ -60,5 +59,4 @@ OMIT_GNULIB_MODULE_sys_select = true OMIT_GNULIB_MODULE_sys_stat = true OMIT_GNULIB_MODULE_sys_time = true OMIT_GNULIB_MODULE_sys_types = true -OMIT_GNULIB_MODULE_tempname = true OMIT_GNULIB_MODULE_unistd = true diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index 957d8c6bdbc..e1dbe29bbb8 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h @@ -237,9 +237,6 @@ extern void w32_reset_stack_overflow_guard (void); #define fopen sys_fopen #define link sys_link #define localtime sys_localtime -#define mkdir sys_mkdir -#undef open -#define open sys_open #undef read #define read sys_read #define rename sys_rename @@ -289,6 +286,10 @@ extern int sys_umask (int); #endif /* emacs */ +/* Used both in Emacs, in lib-src, and in Gnulib. */ +#undef open +#define open sys_open + /* Map to MSVC names. */ #define execlp _execlp #define execvp _execvp @@ -465,6 +466,12 @@ extern char *get_emacs_configuration_options (void); #include <malloc.h> #endif +/* Needed in Emacs and in Gnulib. */ +/* This must be after including sys/stat.h, because we need mode_t. */ +#undef mkdir +#define mkdir(d,f) sys_mkdir(d,f) +int sys_mkdir (const char *, mode_t); + #ifdef emacs typedef void * (* malloc_fn)(size_t); @@ -518,9 +525,9 @@ extern int getpagesize (void); extern void * memrchr (void const *, int, size_t); +/* Declared here, since we don't use Gnulib's stdlib.h. */ extern int mkostemp (char *, int); - #if defined (__MINGW32__) /* Define to 1 if the system has the type `long long int'. */ diff --git a/nt/mingw-cfg.site b/nt/mingw-cfg.site index a1067179797..d9a824008cb 100644 --- a/nt/mingw-cfg.site +++ b/nt/mingw-cfg.site @@ -79,7 +79,6 @@ ac_cv_func_getaddrinfo=yes # Implemented as an inline function in ws2tcpip.h ac_cv_func_gai_strerror=yes # Implemented in w32.c -ac_cv_func_mkostemp=yes ac_cv_func_readlink=yes ac_cv_func_symlink=yes # Avoid run-time tests of readlink and symlink, which will fail |