diff options
Diffstat (limited to 'Build/source/texk/web2c/luatexdir')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/ChangeLog | 1 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/luatex.c | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog index f42fd211713..58a202eba19 100644 --- a/Build/source/texk/web2c/luatexdir/ChangeLog +++ b/Build/source/texk/web2c/luatexdir/ChangeLog @@ -1,6 +1,7 @@ 2010-04-13 Peter Breitenlohner <peb@mppmu.mpg.de> * image/pdftoepdf.cc: Fix building with libpoppler. + * luatex.c: Fix building for MinGW32. 2010-04-13 Taco Hoekwater <taco@luatex> diff --git a/Build/source/texk/web2c/luatexdir/luatex.c b/Build/source/texk/web2c/luatexdir/luatex.c index d3bc2fb1b25..6c934579cfa 100644 --- a/Build/source/texk/web2c/luatexdir/luatex.c +++ b/Build/source/texk/web2c/luatexdir/luatex.c @@ -486,6 +486,9 @@ void topenin(void) incrementally. Shamim Mohamed adapted it for Web2c. */ #if defined (TeX) && defined (IPC) +# ifdef WIN32 +# include <winsock2.h> +# else # include <sys/socket.h> # include <fcntl.h> # ifndef O_NONBLOCK /* POSIX */ @@ -499,6 +502,8 @@ what the fcntl ? cannot implement IPC without equivalent for O_NONBLOCK. # endif /* no FNDELAY */ # endif /* no O_NDELAY */ # endif /* no O_NONBLOCK */ +# endif /* !WIN32 */ + # ifndef IPC_PIPE_NAME /* $HOME is prepended to this. */ # define IPC_PIPE_NAME "/.TeXview_Pipe" # endif @@ -544,6 +549,12 @@ static int ipc_is_open(void) static void ipc_open_out(void) { +#ifdef WIN32 + u_long mode = 1; +#define SOCK_NONBLOCK(s) ioctlsocket (s, FIONBIO, &mode) +#else +#define SOCK_NONBLOCK(s) fcntl (s, F_SETFL, O_NONBLOCK) +#endif # ifdef IPC_DEBUG fputs("tex: Opening socket for IPC output ...\n", stderr); # endif @@ -559,7 +570,7 @@ static void ipc_open_out(void) sock = socket(PF_UNIX, SOCK_STREAM, 0); if (sock >= 0) { if (connect(sock, ipc_addr, ipc_addr_len) != 0 - || fcntl(sock, F_SETFL, O_NONBLOCK) < 0) { + || SOCK_NONBLOCK (sock) < 0) { close(sock); sock = -1; return; |