diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-04-13 15:54:41 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-04-13 15:54:41 +0000 |
commit | 40c685605fff5c81fdbc5f7107d6bb26837570bb (patch) | |
tree | e0936cf7bde8a121e3f44d9e719a0bda498ed1f2 /Build/source/texk/web2c/luatexdir/luatex.c | |
parent | c690a1039d577adfbf4c82ed43bb1f37774829b2 (diff) |
fix linux => mingw32 cross build
git-svn-id: svn://tug.org/texlive/trunk@17843 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/luatex.c')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/luatex.c | 13 |
1 files changed, 12 insertions, 1 deletions
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; |