using std::swap;
Index: src/ispell.C
===================================================================
-RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ispell.C,v
-retrieving revision 1.25
-diff -u -a -u -r1.25 ispell.C
---- src/ispell.C 20 Jan 2005 16:17:36 -0000 1.25
-+++ src/ispell.C 18 Apr 2005 17:37:02 -0000
-@@ -24,11 +24,17 @@
+RCS file: /cvs/lyx/lyx-devel/src/ispell.C,v
+retrieving revision 1.26
+diff -u -r1.26 ispell.C
+--- src/ispell.C 2005/04/26 10:30:21 1.26
++++ src/ispell.C 2005/04/26 15:12:57
+@@ -24,13 +24,19 @@
#include "support/forkedcall.h"
+#ifdef _WIN32
-+# include "support/os_win32.h"
++#include "support/os_win32.h"
+#endif
+
// HP-UX 11.x doesn't have this header
#ifdef HAVE_SYS_SELECT_H
- #include <sys/select.h>
+ # include <sys/select.h>
#endif
--#include <sys/time.h>
+ #ifdef HAVE_SYS_TIME_H
+#ifndef _WIN32
-+# include <sys/time.h>
+ # include <sys/time.h>
+ #endif
+#endif
-
+
using boost::shared_ptr;
-@@ -88,6 +94,7 @@
+@@ -90,6 +96,7 @@
}
// child process
dup2(pipein[0], STDIN_FILENO);
dup2(pipeout[1], STDOUT_FILENO);
dup2(pipeerr[1], STDERR_FILENO);
-@@ -180,6 +187,7 @@
+@@ -182,6 +189,7 @@
lyxerr << "LyX: Failed to start ispell!" << endl;
_exit(0);
}
-@@ -191,6 +199,7 @@
+@@ -193,6 +201,7 @@
{
lyxerr[Debug::GUI] << "Created ispell" << endl;
// static due to the setvbuf. Ugly.
static char o_buf[BUFSIZ];
-@@ -275,6 +284,7 @@
+@@ -277,6 +286,7 @@
close(pipeerr[1]);
child_->kill();
child_.reset(0);
}
-@@ -295,18 +305,23 @@
+@@ -297,18 +307,23 @@
fclose(out);
}
bool ISpell::select(bool & err_read)
{
+#ifdef _WIN32
-+ return false;
++ return false;
+#else
fd_set infds;
struct timeval tv;
int retval = 0;
-@@ -316,11 +331,15 @@
+@@ -318,11 +333,15 @@
tv.tv_sec = 2;
tv.tv_usec = 0;
0,
SELECT_TYPE_ARG5 (&tv));
+#else
-+ retval = -1;
++ retval = -1;
+#endif
// error
if (retval <= 0)
-@@ -335,6 +354,7 @@
+@@ -337,6 +356,7 @@
fgets(buf, BUFSIZ, in);
err_read = false;
return false;
Index: src/lyxserver.C
===================================================================
-RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxserver.C,v
-retrieving revision 1.60
-diff -u -a -u -r1.60 lyxserver.C
---- src/lyxserver.C 15 Feb 2005 11:04:40 -0000 1.60
-+++ src/lyxserver.C 18 Apr 2005 17:37:02 -0000
-@@ -54,6 +54,10 @@
- #include <sys/stat.h>
+RCS file: /cvs/lyx/lyx-devel/src/lyxserver.C,v
+retrieving revision 1.61
+diff -u -r1.61 lyxserver.C
+--- src/lyxserver.C 2005/04/26 10:30:21 1.61
++++ src/lyxserver.C 2005/04/26 15:25:51
+@@ -56,6 +56,10 @@
+ #endif
#include <fcntl.h>
+#ifdef _WIN32
+#endif
+
#ifdef __EMX__
- #include <cstdlib>
- #include <io.h>
-@@ -180,6 +184,8 @@
+ # include <cstdlib>
+ # include <io.h>
+@@ -182,6 +186,8 @@
// Imported handles can be used both with OS/2 APIs and emx
// library functions.
int const fd = _imphandle(os2fd);
+#elif defined(_WIN32)
-+ int fd = -1;
++ int fd = -1;
#else
if (::access(filename.c_str(), F_OK) == 0) {
lyxerr << "LyXComm: Pipe " << filename << " already exists.\n"
-@@ -235,10 +241,12 @@
+@@ -237,10 +243,12 @@
}
#endif
// OS/2 pipes are deleted automatically
#ifndef __EMX__
-@@ -274,7 +282,13 @@
+@@ -276,7 +284,13 @@
errno = 0;
int status;
// the single = is intended here.
- while ((status = ::read(infd, charbuf, charbuf_size - 1))) {
-+ while ((status =
++ while ((status =
+#ifndef _WIN32
-+ ::read(infd, charbuf, charbuf_size - 1)
++ ::read(infd, charbuf, charbuf_size - 1)
+#else
-+ -1
++ -1
+#endif
-+ )) {
++ )) {
if (status > 0) {
charbuf[status] = '\0'; // turn it into a c string
-@@ -331,6 +345,9 @@
+@@ -333,6 +347,9 @@
if (pipename.empty()) return;
+#ifdef _WIN32
-+ return;
++ return;
+#else
if (!ready) {
lyxerr << "LyXComm: Pipes are closed. Could not send "
<< msg << endl;
-@@ -341,6 +358,7 @@
+@@ -343,6 +360,7 @@
closeConnection();
openConnection();
}
int errnum;
Index: src/lyxsocket.C
===================================================================
-RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxsocket.C,v
-retrieving revision 1.7
-diff -u -a -u -r1.7 lyxsocket.C
---- src/lyxsocket.C 15 Feb 2005 13:45:40 -0000 1.7
-+++ src/lyxsocket.C 18 Apr 2005 17:37:02 -0000
-@@ -69,7 +69,9 @@
+RCS file: /cvs/lyx/lyx-devel/src/lyxsocket.C,v
+retrieving revision 1.8
+diff -u -r1.8 lyxsocket.C
+--- src/lyxsocket.C 2005/04/26 10:30:21 1.8
++++ src/lyxsocket.C 2005/04/26 15:31:56
+@@ -71,7 +71,9 @@
LyXServerSocket::~LyXServerSocket()
{
lyx_gui::unregister_socket_callback(fd_);
lyx::support::unlink(address_);
lyxerr[Debug::LYXSERVER] << "lyx: Server socket quitting" << endl;
}
-@@ -156,7 +158,11 @@
+@@ -158,7 +160,11 @@
{
string const linen(line + '\n');
int const size = linen.size();
+#ifndef _WIN32
int const written = ::write(fd_, linen.c_str(), size);
+#else
-+ int const written = -1;
++ int const written = -1;
+#endif
if (written < size) { // Allways mean end of connection.
if ((written == -1) && (errno == EPIPE)) {
// The program will also receive a SIGPIPE
-@@ -195,7 +201,9 @@
+@@ -197,7 +203,9 @@
LyXDataSocket::~LyXDataSocket()
{
lyx_gui::unregister_socket_callback(fd_);
lyxerr[Debug::LYXSERVER] << "lyx: Data socket " << fd_ << " quitting."
-@@ -217,7 +225,13 @@
+@@ -219,7 +227,13 @@
int count;
// read and store characters in buffer
- while ((count = ::read(fd_, charbuf, charbuf_size - 1)) > 0) {
-+ while ((count =
++ while ((count =
+#ifndef _WIN32
-+ ::read(fd_, charbuf, charbuf_size - 1)
++ ::read(fd_, charbuf, charbuf_size - 1)
+#else
-+ 0
++ 0
+#endif
-+ ) > 0) {
++ ) > 0) {
buffer_.append(charbuf, charbuf + count);
}
-@@ -251,7 +265,11 @@
+@@ -253,7 +267,11 @@
{
string const linen(line + '\n');
int const size = linen.size();
+#ifndef _WIN32
int const written = ::write(fd_, linen.c_str(), size);
+#else
-+ int const written = -1;
++ int const written = -1;
+#endif
if (written < size) { // Allways mean end of connection.
if ((written == -1) && (errno == EPIPE)) {
// The program will also receive a SIGPIPE
Index: src/client/client.C
===================================================================
-RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/client/client.C,v
-retrieving revision 1.7
-diff -u -a -u -r1.7 client.C
---- src/client/client.C 20 Jan 2005 15:38:13 -0000 1.7
-+++ src/client/client.C 18 Apr 2005 17:37:02 -0000
-@@ -25,12 +25,14 @@
+RCS file: /cvs/lyx/lyx-devel/src/client/client.C,v
+retrieving revision 1.8
+diff -u -r1.8 client.C
+--- src/client/client.C 2005/04/26 10:30:22 1.8
++++ src/client/client.C 2005/04/26 15:36:18
+@@ -27,6 +27,7 @@
# include <unistd.h>
#endif
+#ifndef _WIN32
// select()
--#include <sys/select.h>
-+# include <sys/select.h>
-
- // socket(), connect()
--#include <sys/socket.h>
--#include <sys/un.h>
-+# include <sys/socket.h>
-+# include <sys/un.h>
+ #ifdef HAVE_SYS_SELECT_H
+ # include <sys/select.h>
+@@ -37,6 +38,7 @@
+ # include <sys/socket.h>
+ #endif
+ #include <sys/un.h>
+#endif
// fcntl()
#include <fcntl.h>
Index: src/frontends/LyXView.C
===================================================================
-RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/LyXView.C,v
-retrieving revision 1.51
-diff -u -a -u -r1.51 LyXView.C
---- src/frontends/LyXView.C 13 Apr 2005 09:43:57 -0000 1.51
-+++ src/frontends/LyXView.C 18 Apr 2005 17:37:02 -0000
-@@ -39,7 +39,9 @@
+RCS file: /cvs/lyx/lyx-devel/src/frontends/LyXView.C,v
+retrieving revision 1.52
+diff -u -r1.52 LyXView.C
+--- src/frontends/LyXView.C 2005/04/26 10:30:22 1.52
++++ src/frontends/LyXView.C 2005/04/26 15:39:37
+@@ -39,8 +39,10 @@
#include <boost/bind.hpp>
--#include <sys/time.h>
+#ifndef _WIN32
-+# include <sys/time.h>
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+#endif
+ #endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
- #endif
Index: src/frontends/qt2/QLyXKeySym.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QLyXKeySym.C,v
encoding_map["iso8859-2"] = QTextCodec::codecForName("ISO 8859-2");
Index: src/support/filetools.C
===================================================================
-RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/filetools.C,v
-retrieving revision 1.207
-diff -u -a -u -r1.207 filetools.C
---- src/support/filetools.C 18 Apr 2005 17:43:11 -0000 1.207
-+++ src/support/filetools.C 19 Apr 2005 10:11:54 -0000
-@@ -1052,6 +1051,11 @@
+RCS file: /cvs/lyx/lyx-devel/src/support/filetools.C,v
+retrieving revision 1.209
+diff -u -r1.209 filetools.C
+--- src/support/filetools.C 2005/04/21 14:03:30 1.209
++++ src/support/filetools.C 2005/04/26 15:43:13
+@@ -1051,6 +1051,11 @@
cmd_ret const RunCommand(string const & cmd)
{
// FIXME: replace all calls to RunCommand with ForkedCall
// (if the output is not needed) or the code in ispell.C
// (if the output is needed).
-@@ -1092,6 +1096,7 @@
- sigprocmask(SIG_SETMASK, &oldMask, 0);
+@@ -1080,6 +1085,7 @@
+ perror("RunCommand:: could not terminate child process");
return make_pair(pret, ret);
+#endif
}
-Index: src/support/globbing.C
-===================================================================
-RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/globbing.C,v
-retrieving revision 1.11
-diff -u -a -u -r1.11 globbing.C
---- src/support/globbing.C 26 Nov 2004 14:37:40 -0000 1.11
-+++ src/support/globbing.C 19 Apr 2005 08:09:32 -0000
-@@ -10,6 +10,8 @@
-
- #include <config.h>
-
-+#if !defined (_WIN32)
-+
- #include "support/globbing.h"
- #include "support/path.h"
-
-@@ -42,3 +44,5 @@
-
- } // namespace support
- } // namespace lyx
-+
-+#endif
Index: src/support/os_win32.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/support/os_win32.C,v
} // namespace socktools
Index: src/support/tempname.C
===================================================================
-RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/tempname.C,v
-retrieving revision 1.25
-diff -u -a -u -r1.25 tempname.C
---- src/support/tempname.C 20 Jan 2005 15:38:14 -0000 1.25
-+++ src/support/tempname.C 19 Apr 2005 08:09:40 -0000
-@@ -30,6 +30,10 @@
- # include <sys/stat.h>
+RCS file: /cvs/lyx/lyx-devel/src/support/tempname.C,v
+retrieving revision 1.26
+diff -u -r1.26 tempname.C
+--- src/support/tempname.C 2005/04/26 10:30:24 1.26
++++ src/support/tempname.C 2005/04/26 15:51:22
+@@ -32,6 +32,10 @@
+ # endif
#endif
+#ifdef _WIN32
using boost::scoped_array;
using std::string;
-@@ -42,6 +46,9 @@
+@@ -44,6 +48,9 @@
{
#if defined(HAVE_MKSTEMP)
return ::mkstemp(templ);
+#elif defined(_WIN32)
-+ ::_mktemp(templ);
-+ return (int) ::fopen(templ, "w");
++ ::_mktemp(templ);
++ return (int) ::fopen(templ, "w");
#elif defined(HAVE_MKTEMP)
// This probably just barely works...
::mktemp(templ);
-@@ -58,7 +65,9 @@
+@@ -60,7 +67,9 @@
{
string const tmpdir(dir.empty() ? package().temp_dir() : dir);
string tmpfl(AddName(tmpdir, mask));
tmpfl += "XXXXXX";
// The supposedly safe mkstemp version
-@@ -69,7 +78,11 @@
+@@ -71,7 +80,11 @@
int const tmpf = make_tempfile(tmpl.get());
if (tmpf != -1) {
string const t(tmpl.get());
+#ifdef _WIN32
-+ ::fclose((FILE *) tmpf);
++ ::fclose((FILE *) tmpf);
+#else
::close(tmpf);
+#endif