2005-01-31 16:35:16 +00:00
|
|
|
Index: src/DepTable.C
|
|
|
|
===================================================================
|
2005-04-20 17:50:34 +00:00
|
|
|
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/DepTable.C,v
|
2005-01-31 16:35:16 +00:00
|
|
|
retrieving revision 1.41
|
2005-04-20 17:50:34 +00:00
|
|
|
diff -u -a -u -r1.41 DepTable.C
|
|
|
|
--- src/DepTable.C 13 Oct 2003 01:01:33 -0000 1.41
|
|
|
|
+++ src/DepTable.C 18 Apr 2005 17:37:02 -0000
|
2005-01-31 16:35:16 +00:00
|
|
|
@@ -26,7 +26,9 @@
|
|
|
|
#include <fstream>
|
|
|
|
|
|
|
|
#ifndef CXX_GLOBAL_CSTD
|
|
|
|
+# ifndef _WIN32
|
|
|
|
using std::time;
|
|
|
|
+# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
using lyx::support::ltrim;
|
|
|
|
Index: src/buffer.C
|
|
|
|
===================================================================
|
2005-04-20 17:50:34 +00:00
|
|
|
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
|
|
|
|
retrieving revision 1.615
|
|
|
|
diff -u -a -u -r1.615 buffer.C
|
|
|
|
--- src/buffer.C 18 Apr 2005 17:43:08 -0000 1.615
|
|
|
|
+++ src/buffer.C 18 Apr 2005 17:37:02 -0000
|
|
|
|
@@ -78,7 +78,11 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
#include <boost/bind.hpp>
|
|
|
|
#include <boost/filesystem/operations.hpp>
|
|
|
|
|
|
|
|
-#include <utime.h>
|
|
|
|
+#ifdef _WIN32
|
|
|
|
+# include <windows.h>
|
|
|
|
+#else
|
|
|
|
+# include <utime.h>
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
#include <iomanip>
|
|
|
|
#include <stack>
|
|
|
|
Index: src/cursor.C
|
|
|
|
===================================================================
|
2005-04-20 17:50:34 +00:00
|
|
|
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.C,v
|
|
|
|
retrieving revision 1.123
|
|
|
|
diff -u -a -u -r1.123 cursor.C
|
|
|
|
--- src/cursor.C 25 Feb 2005 11:55:31 -0000 1.123
|
|
|
|
+++ src/cursor.C 18 Apr 2005 17:37:02 -0000
|
2005-01-31 16:35:16 +00:00
|
|
|
@@ -58,7 +58,9 @@
|
|
|
|
using std::vector;
|
|
|
|
using std::endl;
|
|
|
|
#ifndef CXX_GLOBAL_CSTD
|
|
|
|
+# ifndef _WIN32
|
|
|
|
using std::isalpha;
|
|
|
|
+# endif
|
|
|
|
#endif
|
|
|
|
using std::min;
|
|
|
|
using std::swap;
|
|
|
|
Index: src/ispell.C
|
|
|
|
===================================================================
|
2005-04-26 17:10:09 +00:00
|
|
|
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 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
|
|
|
|
#include "support/forkedcall.h"
|
|
|
|
|
|
|
|
+#ifdef _WIN32
|
2005-04-26 17:10:09 +00:00
|
|
|
+#include "support/os_win32.h"
|
2005-01-31 16:35:16 +00:00
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
// HP-UX 11.x doesn't have this header
|
|
|
|
#ifdef HAVE_SYS_SELECT_H
|
2005-04-26 17:10:09 +00:00
|
|
|
# include <sys/select.h>
|
2005-02-23 18:01:58 +00:00
|
|
|
#endif
|
2005-04-26 17:10:09 +00:00
|
|
|
#ifdef HAVE_SYS_TIME_H
|
2005-04-20 17:50:34 +00:00
|
|
|
+#ifndef _WIN32
|
2005-04-26 17:10:09 +00:00
|
|
|
# include <sys/time.h>
|
|
|
|
#endif
|
2005-04-20 17:50:34 +00:00
|
|
|
+#endif
|
2005-04-26 17:10:09 +00:00
|
|
|
|
2005-01-31 16:35:16 +00:00
|
|
|
using boost::shared_ptr;
|
|
|
|
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -90,6 +96,7 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// child process
|
|
|
|
+#ifndef _WIN32
|
|
|
|
dup2(pipein[0], STDIN_FILENO);
|
|
|
|
dup2(pipeout[1], STDOUT_FILENO);
|
|
|
|
dup2(pipeerr[1], STDERR_FILENO);
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -182,6 +189,7 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
|
|
|
|
lyxerr << "LyX: Failed to start ispell!" << endl;
|
|
|
|
_exit(0);
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -193,6 +201,7 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
{
|
|
|
|
lyxerr[Debug::GUI] << "Created ispell" << endl;
|
|
|
|
|
|
|
|
+#ifndef _WIN32
|
|
|
|
// static due to the setvbuf. Ugly.
|
|
|
|
static char o_buf[BUFSIZ];
|
|
|
|
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -277,6 +286,7 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
close(pipeerr[1]);
|
|
|
|
child_->kill();
|
|
|
|
child_.reset(0);
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -297,18 +307,23 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
fclose(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifndef _WIN32
|
|
|
|
close(pipein[0]);
|
|
|
|
close(pipein[1]);
|
|
|
|
close(pipeout[0]);
|
|
|
|
close(pipeout[1]);
|
|
|
|
close(pipeerr[0]);
|
|
|
|
close(pipeerr[1]);
|
|
|
|
+#endif
|
|
|
|
delete [] str;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool ISpell::select(bool & err_read)
|
|
|
|
{
|
|
|
|
+#ifdef _WIN32
|
2005-04-26 17:10:09 +00:00
|
|
|
+ return false;
|
2005-01-31 16:35:16 +00:00
|
|
|
+#else
|
|
|
|
fd_set infds;
|
|
|
|
struct timeval tv;
|
|
|
|
int retval = 0;
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -318,11 +333,15 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
tv.tv_sec = 2;
|
|
|
|
tv.tv_usec = 0;
|
|
|
|
|
|
|
|
+#ifdef HAVE_SELECT
|
|
|
|
retval = ::select(SELECT_TYPE_ARG1 (max(pipeout[0], pipeerr[0]) + 1),
|
|
|
|
SELECT_TYPE_ARG234 (&infds),
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
SELECT_TYPE_ARG5 (&tv));
|
|
|
|
+#else
|
2005-04-26 17:10:09 +00:00
|
|
|
+ retval = -1;
|
2005-01-31 16:35:16 +00:00
|
|
|
+#endif
|
|
|
|
|
|
|
|
// error
|
|
|
|
if (retval <= 0)
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -337,6 +356,7 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
fgets(buf, BUFSIZ, in);
|
|
|
|
err_read = false;
|
|
|
|
return false;
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Index: src/lyx_cb.C
|
|
|
|
===================================================================
|
2005-04-20 17:50:34 +00:00
|
|
|
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_cb.C,v
|
2005-01-31 16:35:16 +00:00
|
|
|
retrieving revision 1.247
|
2005-04-20 17:50:34 +00:00
|
|
|
diff -u -a -u -r1.247 lyx_cb.C
|
|
|
|
--- src/lyx_cb.C 31 Jan 2005 10:42:18 -0000 1.247
|
|
|
|
+++ src/lyx_cb.C 18 Apr 2005 17:37:02 -0000
|
2005-01-31 16:35:16 +00:00
|
|
|
@@ -44,6 +44,10 @@
|
|
|
|
#include "support/path.h"
|
|
|
|
#include "support/systemcall.h"
|
|
|
|
|
|
|
|
+#ifdef _WIN32
|
|
|
|
+# include "support/os_win32.h" // fork()
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
#include <boost/filesystem/operations.hpp>
|
|
|
|
|
|
|
|
Index: src/lyxserver.C
|
|
|
|
===================================================================
|
2005-04-26 17:10:09 +00:00
|
|
|
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
|
2005-01-31 16:35:16 +00:00
|
|
|
#include <fcntl.h>
|
|
|
|
|
|
|
|
+#ifdef _WIN32
|
|
|
|
+# include "support/os_win32.h" // F_SETFL, O_NONBLOCK, fcntl
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#ifdef __EMX__
|
2005-04-26 17:10:09 +00:00
|
|
|
# include <cstdlib>
|
|
|
|
# include <io.h>
|
|
|
|
@@ -182,6 +186,8 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
// Imported handles can be used both with OS/2 APIs and emx
|
|
|
|
// library functions.
|
2005-02-23 18:01:58 +00:00
|
|
|
int const fd = _imphandle(os2fd);
|
2005-01-31 16:35:16 +00:00
|
|
|
+#elif defined(_WIN32)
|
2005-04-26 17:10:09 +00:00
|
|
|
+ int fd = -1;
|
2005-01-31 16:35:16 +00:00
|
|
|
#else
|
|
|
|
if (::access(filename.c_str(), F_OK) == 0) {
|
|
|
|
lyxerr << "LyXComm: Pipe " << filename << " already exists.\n"
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -237,10 +243,12 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
+#ifndef _WIN32
|
|
|
|
if (::close(fd) < 0) {
|
|
|
|
lyxerr << "LyXComm: Could not close pipe " << filename
|
|
|
|
<< '\n' << strerror(errno) << endl;
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
// OS/2 pipes are deleted automatically
|
|
|
|
#ifndef __EMX__
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -276,7 +284,13 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
errno = 0;
|
|
|
|
int status;
|
|
|
|
// the single = is intended here.
|
|
|
|
- while ((status = ::read(infd, charbuf, charbuf_size - 1))) {
|
2005-04-26 17:10:09 +00:00
|
|
|
+ while ((status =
|
2005-01-31 16:35:16 +00:00
|
|
|
+#ifndef _WIN32
|
2005-04-26 17:10:09 +00:00
|
|
|
+ ::read(infd, charbuf, charbuf_size - 1)
|
2005-01-31 16:35:16 +00:00
|
|
|
+#else
|
2005-04-26 17:10:09 +00:00
|
|
|
+ -1
|
2005-01-31 16:35:16 +00:00
|
|
|
+#endif
|
2005-04-26 17:10:09 +00:00
|
|
|
+ )) {
|
2005-01-31 16:35:16 +00:00
|
|
|
|
|
|
|
if (status > 0) {
|
|
|
|
charbuf[status] = '\0'; // turn it into a c string
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -333,6 +347,9 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
|
|
|
|
if (pipename.empty()) return;
|
|
|
|
|
|
|
|
+#ifdef _WIN32
|
2005-04-26 17:10:09 +00:00
|
|
|
+ return;
|
2005-01-31 16:35:16 +00:00
|
|
|
+#else
|
|
|
|
if (!ready) {
|
|
|
|
lyxerr << "LyXComm: Pipes are closed. Could not send "
|
|
|
|
<< msg << endl;
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -343,6 +360,7 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
closeConnection();
|
|
|
|
openConnection();
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
#ifdef __EMX__
|
|
|
|
APIRET rc;
|
|
|
|
int errnum;
|
|
|
|
Index: src/lyxsocket.C
|
|
|
|
===================================================================
|
2005-04-26 17:10:09 +00:00
|
|
|
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 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
LyXServerSocket::~LyXServerSocket()
|
|
|
|
{
|
|
|
|
lyx_gui::unregister_socket_callback(fd_);
|
|
|
|
+#ifndef _WIN32
|
|
|
|
::close(fd_);
|
|
|
|
+#endif
|
|
|
|
lyx::support::unlink(address_);
|
|
|
|
lyxerr[Debug::LYXSERVER] << "lyx: Server socket quitting" << endl;
|
|
|
|
}
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -158,7 +160,11 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
{
|
|
|
|
string const linen(line + '\n');
|
|
|
|
int const size = linen.size();
|
|
|
|
+#ifndef _WIN32
|
|
|
|
int const written = ::write(fd_, linen.c_str(), size);
|
|
|
|
+#else
|
2005-04-26 17:10:09 +00:00
|
|
|
+ int const written = -1;
|
2005-01-31 16:35:16 +00:00
|
|
|
+#endif
|
|
|
|
if (written < size) { // Allways mean end of connection.
|
|
|
|
if ((written == -1) && (errno == EPIPE)) {
|
|
|
|
// The program will also receive a SIGPIPE
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -197,7 +203,9 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
|
|
|
|
LyXDataSocket::~LyXDataSocket()
|
|
|
|
{
|
|
|
|
+#ifndef _WIN32
|
|
|
|
::close(fd_);
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
lyx_gui::unregister_socket_callback(fd_);
|
|
|
|
lyxerr[Debug::LYXSERVER] << "lyx: Data socket " << fd_ << " quitting."
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -219,7 +227,13 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
int count;
|
|
|
|
|
|
|
|
// read and store characters in buffer
|
|
|
|
- while ((count = ::read(fd_, charbuf, charbuf_size - 1)) > 0) {
|
2005-04-26 17:10:09 +00:00
|
|
|
+ while ((count =
|
2005-01-31 16:35:16 +00:00
|
|
|
+#ifndef _WIN32
|
2005-04-26 17:10:09 +00:00
|
|
|
+ ::read(fd_, charbuf, charbuf_size - 1)
|
2005-01-31 16:35:16 +00:00
|
|
|
+#else
|
2005-04-26 17:10:09 +00:00
|
|
|
+ 0
|
2005-01-31 16:35:16 +00:00
|
|
|
+#endif
|
2005-04-26 17:10:09 +00:00
|
|
|
+ ) > 0) {
|
2005-01-31 16:35:16 +00:00
|
|
|
buffer_.append(charbuf, charbuf + count);
|
|
|
|
}
|
|
|
|
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -253,7 +267,11 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
{
|
|
|
|
string const linen(line + '\n');
|
|
|
|
int const size = linen.size();
|
|
|
|
+#ifndef _WIN32
|
|
|
|
int const written = ::write(fd_, linen.c_str(), size);
|
|
|
|
+#else
|
2005-04-26 17:10:09 +00:00
|
|
|
+ int const written = -1;
|
2005-01-31 16:35:16 +00:00
|
|
|
+#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
|
|
|
|
===================================================================
|
2005-04-26 17:10:09 +00:00
|
|
|
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 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
# include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
+#ifndef _WIN32
|
|
|
|
// select()
|
2005-04-26 17:10:09 +00:00
|
|
|
#ifdef HAVE_SYS_SELECT_H
|
|
|
|
# include <sys/select.h>
|
|
|
|
@@ -37,6 +38,7 @@
|
|
|
|
# include <sys/socket.h>
|
|
|
|
#endif
|
|
|
|
#include <sys/un.h>
|
2005-01-31 16:35:16 +00:00
|
|
|
+#endif
|
|
|
|
|
|
|
|
// fcntl()
|
|
|
|
#include <fcntl.h>
|
|
|
|
Index: src/frontends/LyXView.C
|
|
|
|
===================================================================
|
2005-04-26 17:10:09 +00:00
|
|
|
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 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
|
|
|
|
#include <boost/bind.hpp>
|
|
|
|
|
|
|
|
+#ifndef _WIN32
|
2005-04-26 17:10:09 +00:00
|
|
|
#ifdef HAVE_SYS_TIME_H
|
|
|
|
# include <sys/time.h>
|
2005-01-31 16:35:16 +00:00
|
|
|
+#endif
|
2005-04-26 17:10:09 +00:00
|
|
|
#endif
|
2005-01-31 16:35:16 +00:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
# include <unistd.h>
|
2005-02-14 09:40:34 +00:00
|
|
|
Index: src/frontends/qt2/QLyXKeySym.C
|
|
|
|
===================================================================
|
2005-04-20 17:50:34 +00:00
|
|
|
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QLyXKeySym.C,v
|
2005-02-14 09:40:34 +00:00
|
|
|
retrieving revision 1.32
|
2005-04-20 17:50:34 +00:00
|
|
|
diff -u -a -u -r1.32 QLyXKeySym.C
|
|
|
|
--- src/frontends/qt2/QLyXKeySym.C 7 Jul 2004 09:32:19 -0000 1.32
|
|
|
|
+++ src/frontends/qt2/QLyXKeySym.C 18 Apr 2005 17:37:02 -0000
|
2005-02-14 09:40:34 +00:00
|
|
|
@@ -74,7 +74,7 @@
|
|
|
|
void initEncodings()
|
|
|
|
{
|
|
|
|
// when no document open
|
|
|
|
- encoding_map[""] = QTextCodec::codecForLocale();
|
|
|
|
+ encoding_map[std::string()] = QTextCodec::codecForLocale();
|
|
|
|
|
|
|
|
encoding_map["iso8859-1"] = QTextCodec::codecForName("ISO 8859-1");
|
|
|
|
encoding_map["iso8859-2"] = QTextCodec::codecForName("ISO 8859-2");
|
2005-01-31 16:35:16 +00:00
|
|
|
Index: src/support/filetools.C
|
|
|
|
===================================================================
|
2005-04-26 17:10:09 +00:00
|
|
|
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 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
|
|
|
|
cmd_ret const RunCommand(string const & cmd)
|
|
|
|
{
|
|
|
|
+#ifdef _WIN32
|
|
|
|
+ // TODO: Implement this, or merge it into forkedcall.
|
|
|
|
+ // Used for lyx2lyx in buffer.C, echo in math_extern and kpse in this file
|
|
|
|
+ return make_pair(-1, string());
|
|
|
|
+#else
|
|
|
|
// 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).
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -1080,6 +1085,7 @@
|
|
|
|
perror("RunCommand:: could not terminate child process");
|
2005-01-31 16:35:16 +00:00
|
|
|
|
|
|
|
return make_pair(pret, ret);
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-14 09:40:34 +00:00
|
|
|
Index: src/support/os_win32.C
|
|
|
|
===================================================================
|
2005-02-23 18:01:58 +00:00
|
|
|
RCS file: /cvs/lyx/lyx-devel/src/support/os_win32.C,v
|
2005-02-14 09:40:34 +00:00
|
|
|
retrieving revision 1.27
|
|
|
|
diff -u -r1.27 os_win32.C
|
2005-02-23 18:01:58 +00:00
|
|
|
--- src/support/os_win32.C 2005/01/21 22:08:59 1.27
|
|
|
|
+++ src/support/os_win32.C 2005/02/17 18:19:25
|
2005-02-14 09:40:34 +00:00
|
|
|
@@ -89,12 +89,14 @@
|
|
|
|
// Close the console when run (probably)
|
|
|
|
// not run from command prompt
|
|
|
|
char WindowTitle[1024];
|
|
|
|
- HWND hwndFound;
|
|
|
|
- GetConsoleTitle(WindowTitle,1024);
|
|
|
|
+ if (GetConsoleTitle(WindowTitle, sizeof(WindowTitle)) == 0) {
|
|
|
|
+ // Could not get the title, so we just leave things as they are
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
if ((strcmp(WindowTitle, argv[0]) == 0) ||
|
|
|
|
- (strcmp(WindowTitle,"LyX") == 0)) {
|
|
|
|
+ (strcmp(WindowTitle, "LyX") == 0)) {
|
|
|
|
// format a "unique" newWindowTitle
|
|
|
|
- wsprintf(WindowTitle,"%d/%d",
|
|
|
|
+ wsprintf(WindowTitle, "%d/%d",
|
|
|
|
GetTickCount(),
|
|
|
|
GetCurrentProcessId());
|
|
|
|
// change current window title
|
|
|
|
@@ -102,10 +104,11 @@
|
|
|
|
// ensure window title has been updated
|
|
|
|
Sleep(40);
|
|
|
|
// look for newWindowTitle
|
|
|
|
- hwndFound=FindWindow(NULL, WindowTitle);
|
|
|
|
+ HWND hwndFound = FindWindow(NULL, WindowTitle);
|
|
|
|
// If found, hide it
|
|
|
|
- if ( hwndFound != NULL)
|
|
|
|
+ if ( hwndFound != NULL) {
|
|
|
|
ShowWindow( hwndFound, SW_HIDE);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-01-31 16:35:16 +00:00
|
|
|
Index: src/support/socktools.C
|
|
|
|
===================================================================
|
2005-04-20 17:50:34 +00:00
|
|
|
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/socktools.C,v
|
2005-01-31 16:35:16 +00:00
|
|
|
retrieving revision 1.6
|
2005-04-20 17:50:34 +00:00
|
|
|
diff -u -a -u -r1.6 socktools.C
|
|
|
|
--- src/support/socktools.C 20 Jan 2005 15:38:14 -0000 1.6
|
|
|
|
+++ src/support/socktools.C 19 Apr 2005 08:09:40 -0000
|
2005-01-31 16:35:16 +00:00
|
|
|
@@ -15,8 +15,10 @@
|
|
|
|
|
|
|
|
#include "debug.h"
|
|
|
|
|
|
|
|
+#ifndef _WIN32
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <sys/un.h>
|
|
|
|
+#endif
|
|
|
|
#include <fcntl.h>
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
# include <unistd.h>
|
|
|
|
@@ -48,6 +50,7 @@
|
|
|
|
// special file 'name' will be created in the filesystem.
|
|
|
|
int listen(string const & name, int queue)
|
|
|
|
{
|
|
|
|
+#ifndef _WIN32
|
|
|
|
int fd; // File descriptor for the socket
|
|
|
|
sockaddr_un addr; // Structure that hold the socket address
|
|
|
|
|
|
|
|
@@ -105,14 +108,17 @@
|
|
|
|
lyx::support::unlink(name);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
-
|
|
|
|
return fd;
|
|
|
|
+#else
|
|
|
|
+ return -1;
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns a file descriptor for a new connection from the socket
|
|
|
|
// descriptor 'sd' (or -1 in case of error)
|
|
|
|
int accept(int sd)
|
|
|
|
{
|
|
|
|
+#ifndef _WIN32
|
|
|
|
int fd;
|
|
|
|
|
|
|
|
// Returns the new file descriptor or -1 in case of error
|
|
|
|
@@ -132,6 +138,9 @@
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return fd;
|
|
|
|
+#else
|
|
|
|
+ return -1;
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace socktools
|
|
|
|
Index: src/support/tempname.C
|
|
|
|
===================================================================
|
2005-04-26 17:10:09 +00:00
|
|
|
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
|
2005-01-31 16:35:16 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
+#ifdef _WIN32
|
|
|
|
+# include <io.h>
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
using boost::scoped_array;
|
|
|
|
|
|
|
|
using std::string;
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -44,6 +48,9 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
{
|
|
|
|
#if defined(HAVE_MKSTEMP)
|
|
|
|
return ::mkstemp(templ);
|
|
|
|
+#elif defined(_WIN32)
|
2005-04-26 17:10:09 +00:00
|
|
|
+ ::_mktemp(templ);
|
|
|
|
+ return (int) ::fopen(templ, "w");
|
2005-01-31 16:35:16 +00:00
|
|
|
#elif defined(HAVE_MKTEMP)
|
|
|
|
// This probably just barely works...
|
|
|
|
::mktemp(templ);
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -60,7 +67,9 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
{
|
|
|
|
string const tmpdir(dir.empty() ? package().temp_dir() : dir);
|
|
|
|
string tmpfl(AddName(tmpdir, mask));
|
|
|
|
+#ifndef _WIN32
|
|
|
|
tmpfl += convert<string>(getpid());
|
|
|
|
+#endif
|
|
|
|
tmpfl += "XXXXXX";
|
|
|
|
|
|
|
|
// The supposedly safe mkstemp version
|
2005-04-26 17:10:09 +00:00
|
|
|
@@ -71,7 +80,11 @@
|
2005-01-31 16:35:16 +00:00
|
|
|
int const tmpf = make_tempfile(tmpl.get());
|
|
|
|
if (tmpf != -1) {
|
|
|
|
string const t(tmpl.get());
|
|
|
|
+#ifdef _WIN32
|
2005-04-26 17:10:09 +00:00
|
|
|
+ ::fclose((FILE *) tmpf);
|
2005-01-31 16:35:16 +00:00
|
|
|
+#else
|
|
|
|
::close(tmpf);
|
|
|
|
+#endif
|
|
|
|
lyxerr[Debug::FILES] << "Temporary file `" << t
|
|
|
|
<< "' created." << endl;
|
|
|
|
return t;
|