lyx_mirror/development/Win32/win32_kludge.diff
Angus Leeming d0daca097c Update the kludge patch whilst we work out how best to address the
remaining issues.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@9844 a592a061-630c-0410-9148-cb99ea01b6c8
2005-04-20 17:38:25 +00:00

131 lines
2.9 KiB
Diff

Index: src/ispell.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ispell.C,v
retrieving revision 1.5.2.5
diff -u -a -u -r1.5.2.5 ispell.C
--- src/ispell.C 7 Dec 2004 10:48:23 -0000 1.5.2.5
+++ src/ispell.C 15 Apr 2005 22:28:12 -0000
@@ -21,12 +21,28 @@
#include "support/forkedcall.h"
#include "support/lstrings.h"
+#ifdef _WIN32
+// sys/select.h
+# define FD_ZERO(a)
+# define FD_SET(a,b)
+# define FD_ISSET(fd, set) 0
+//sys/types.h
+# define fd_set int
+// unistd.h
+# define fork() -1
+# define pipe(a) _pipe(a,0,0)
+#endif
+
// HP-UX 11.x doesn't have this header
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#include <sys/time.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
#ifndef CXX_GLOBAL_CSTD
using std::strcpy;
using std::strlen;
@@ -309,11 +325,15 @@
tv.tv_sec = 2;
tv.tv_usec = 0;
+#ifdef _WIN32
+ retval = -1;
+#else
retval = ::select(SELECT_TYPE_ARG1 (max(pipeout[0], pipeerr[0]) + 1),
SELECT_TYPE_ARG234 (&infds),
0,
0,
SELECT_TYPE_ARG5 (&tv));
+#endif
// error
if (retval <= 0)
Index: src/lyx_cb.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_cb.C,v
retrieving revision 1.190.2.3
diff -u -a -u -r1.190.2.3 lyx_cb.C
--- src/lyx_cb.C 10 Jan 2005 19:17:24 -0000 1.190.2.3
+++ src/lyx_cb.C 15 Apr 2005 20:29:06 -0000
@@ -37,6 +37,11 @@
#include "support/systemcall.h"
#include "support/lstrings.h"
+#ifdef _WIN32
+// unistd.h
+# define fork() -1
+#endif
+
#include "BoostFormat.h"
#include <fstream>
Index: src/lyxserver.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxserver.C,v
retrieving revision 1.48.2.3
diff -u -a -u -r1.48.2.3 lyxserver.C
--- src/lyxserver.C 20 Jan 2005 10:47:28 -0000 1.48.2.3
+++ src/lyxserver.C 15 Apr 2005 22:22:20 -0000
@@ -36,14 +36,6 @@
#include <config.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <fcntl.h>
-#include <cerrno>
-
#include "lyxserver.h"
#include "debug.h"
#include "lyxfunc.h"
@@ -51,14 +43,28 @@
#include "support/lyxlib.h"
#include "frontends/lyx_gui.h"
-#ifdef __EMX__
-#include <cstdlib>
-#include <io.h>
-#define OS2EMX_PLAIN_CHAR
-#define INCL_DOSNMPIPES
-#define INCL_DOSERRORS
-#include <os2.h>
-#include "support/os2_errortable.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <cerrno>
+#include <fcntl.h>
+
+#if defined (_WIN32)
+# define F_SETFD 2
+# define F_SETFL 4
+# define O_NONBLOCK 0x4000
+ inline int fcntl (int, int, ...) {return -1;}
+
+#elif defined (__EMX__)
+# include <cstdlib>
+# include <io.h>
+# define OS2EMX_PLAIN_CHAR
+# define INCL_DOSNMPIPES
+# define INCL_DOSERRORS
+# include <os2.h>
+# include "support/os2_errortable.h"
+
+#else // POSIX
+# include <unistd.h>
#endif
using std::endl;