diff --git a/compat/readv.c b/compat/readv.c index c6f291a854..6b2c2da7e3 100644 --- a/compat/readv.c +++ b/compat/readv.c @@ -26,11 +26,7 @@ #include #include -#ifdef _WIN32 -# include -#else -# include -#endif +#include ssize_t readv(int fd, const struct iovec *iov, int iovcnt) { diff --git a/compat/windows/unistd.h b/compat/windows/unistd.h index a4db2cad87..10add608da 100644 --- a/compat/windows/unistd.h +++ b/compat/windows/unistd.h @@ -29,5 +29,16 @@ // _getpid() exists but it returns an int, not a pid_t typedef int pid_t; +// redirect missing functions from the GDK +#define strdup(s) _strdup(s) + +#define read(fd, dst, count) _read(fd, dst, count) +#define write(fd, src, count) _write(fd, src, count) +#define close(fd) _close(fd) +#define dup(fd) _dup(fd) +#define dup2(fd, f2) _dup2(fd,f2) +#define setmode(fd, m) _setmode(fd,m) +#define fdopen(a, b) _fdopen(a, b) + #endif // WINSDK_UNISTD_H__ diff --git a/compat/writev.c b/compat/writev.c index 10acccb671..2981ba3350 100644 --- a/compat/writev.c +++ b/compat/writev.c @@ -26,11 +26,7 @@ #include #include -#ifdef _WIN32 -# include -#else -# include -#endif +#include ssize_t writev(int fd, const struct iovec *iov, int iovcnt) { diff --git a/src/win32/filesystem.c b/src/win32/filesystem.c index 5929ff698a..7f48e4761e 100644 --- a/src/win32/filesystem.c +++ b/src/win32/filesystem.c @@ -37,17 +37,13 @@ #include #include #include +#include #include #include #include #include "libvlc.h" /* vlc_mkdir */ -#ifdef _MSC_VER -# define __STDC__ 1 -# include /* _pipe */ -#endif - #ifndef NTDDI_WIN10_RS3 #define NTDDI_WIN10_RS3 0x0A000004 #endif