From 64dd61bcb83776a860afcfba640dc43f28cdc385 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 May 2013 21:03:55 +0300 Subject: [PATCH] Minor portabiulity fixes for MS-Windows. makeint.h (ftruncate) [_MSC_VER]: Redirect to _chsize. (_S_ISDIR): If not defined (MinGW64), define to S_ISDIR. --- ChangeLog | 5 +++++ makeint.h | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 498e1270..cc6ba1a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-05-04 Eli Zaretskii + + * makeint.h (ftruncate) [_MSC_VER]: Redirect to _chsize. + (_S_ISDIR): If not defined (MinGW64), define to S_ISDIR. + 2013-05-04 Paul Smith * job.c (child_out): Handle EINTR and incomplete write scenarios. diff --git a/makeint.h b/makeint.h index 535db1d6..9f0d1b81 100644 --- a/makeint.h +++ b/makeint.h @@ -351,6 +351,14 @@ char *strsignal (int signum); # include # define pipe(_p) _pipe((_p), 512, O_BINARY) # define kill(_pid,_sig) w32_kill((_pid),(_sig)) +/* MSVC doesn't have ftruncate. */ +# ifdef _MSC_VER +# define ftruncate(_fd,_len) _chsize(_fd,_len) +# endif +/* MinGW64 doesn't have _S_ISDIR. */ +# ifndef _S_ISDIR +# define _S_ISDIR(m) S_ISDIR(m) +# endif void sync_Path_environment (void); int w32_kill (pid_t pid, int sig);