JMarc,

What do you think about the attached patch? It will allow lyx to
compile with MSVC2003/2005. I know that lyx has been working with msvc
before and I am not sure what autotools have done to walk around
these.

Bo


Index: src/frontends/qt4/BulletsModule.C
===================================================================
--- src/frontends/qt4/BulletsModule.C   (revision 13947)
+++ src/frontends/qt4/BulletsModule.C   (working copy)
@@ -250,6 +250,8 @@
        default:
                return standard_->pixmap(row,col);
        }*/
+       // make qt4 frontend at least compilable now.
+       return QPixmap();
}

Abdel said that this is OK to him.


Index: src/support/lyxsum.C
===================================================================
--- src/support/lyxsum.C        (revision 13947)
+++ src/support/lyxsum.C        (working copy)
@@ -103,8 +103,8 @@

} // namespace

+using std::ifstream;
#if HAVE_DECL_ISTREAMBUF_ITERATOR
-using std::ifstream;
using std::istreambuf_iterator;

unsigned long lyx::support::sum(string const & file)

ifstream is needed for both cases (with/without HAVE_DECL_ISTREAMBUF_ITERATOR)

Index: src/support/tempname.C
===================================================================
--- src/support/tempname.C      (revision 13947)
+++ src/support/tempname.C      (working copy)
@@ -54,6 +54,10 @@
        // This probably just barely works...
        ::mktemp(templ);
# if defined (HAVE_OPEN)
+# if (!defined S_IRUSR)
+#   define S_IRUSR S_IREAD
+#   define S_IWUSR S_IWRITE
+# endif
        return ::open(templ, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
# elif defined (HAVE__OPEN)
        return ::_open(templ,

As far as I know, IRUSR and S_IREAD etc are identical.

Index: src/support/forkedcall.C
===================================================================
--- src/support/forkedcall.C    (revision 13947)
+++ src/support/forkedcall.C    (working copy)
@@ -38,6 +38,7 @@
#include <boost/bind.hpp>

#include <vector>
+#include <cerrno>

#ifdef _WIN32
# define SIGHUP 1
@@ -46,7 +47,6 @@
# include <windows.h>

#else
-# include <cerrno>
# include <csignal>
# include <cstdlib>
# ifdef HAVE_UNISTD_H

I have checked mingw/cygwin/msvc, cerrno exists, but I can not check
gcc prior to 3.4.3. If you want to make sure, I can do a HAVE_CERRNO
test.

Index: src/support/mkdir.C
===================================================================
--- src/support/mkdir.C (revision 13947)
+++ src/support/mkdir.C (working copy)
@@ -22,6 +22,9 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
+#ifdef HAVE_DIRECT_H
+# include <direct.h>
+#endif
#ifdef _WIN32
# include <windows.h>
#endif

mkdir is defined in direct.h, which I will test in scons.

Index: src/support/package.C.in
===================================================================
--- src/support/package.C.in    (revision 13947)
+++ src/support/package.C.in    (working copy)
@@ -44,6 +44,10 @@
# include <CoreServices/CoreServices.h> // FSFindFolder, FSRefMakePath
#endif

+#ifndef PATH_MAX
+#define PATH_MAX 512
+#endif
+
using std::string;

namespace fs = boost::filesystem;

PATH_MAX deos not always exist.

Cheers,
Bo
Index: src/frontends/qt4/BulletsModule.C
===================================================================
--- src/frontends/qt4/BulletsModule.C	(revision 13947)
+++ src/frontends/qt4/BulletsModule.C	(working copy)
@@ -250,6 +250,8 @@
 	default:
 		return standard_->pixmap(row,col);
 	}*/
+	// make qt4 frontend at least compilable now.
+	return QPixmap();
 }
 
 
Index: src/support/lyxsum.C
===================================================================
--- src/support/lyxsum.C	(revision 13947)
+++ src/support/lyxsum.C	(working copy)
@@ -103,8 +103,8 @@
 
 } // namespace
 
+using std::ifstream;
 #if HAVE_DECL_ISTREAMBUF_ITERATOR
-using std::ifstream;
 using std::istreambuf_iterator;
 
 unsigned long lyx::support::sum(string const & file)
Index: src/support/tempname.C
===================================================================
--- src/support/tempname.C	(revision 13947)
+++ src/support/tempname.C	(working copy)
@@ -54,6 +54,10 @@
 	// This probably just barely works...
 	::mktemp(templ);
 # if defined (HAVE_OPEN)
+# if (!defined S_IRUSR)
+#   define S_IRUSR S_IREAD
+#   define S_IWUSR S_IWRITE
+# endif
 	return ::open(templ, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
 # elif defined (HAVE__OPEN)
 	return ::_open(templ,
Index: src/support/forkedcall.C
===================================================================
--- src/support/forkedcall.C	(revision 13947)
+++ src/support/forkedcall.C	(working copy)
@@ -38,6 +38,7 @@
 #include <boost/bind.hpp>
 
 #include <vector>
+#include <cerrno>
 
 #ifdef _WIN32
 # define SIGHUP 1
@@ -46,7 +47,6 @@
 # include <windows.h>
 
 #else
-# include <cerrno>
 # include <csignal>
 # include <cstdlib>
 # ifdef HAVE_UNISTD_H
Index: src/support/mkdir.C
===================================================================
--- src/support/mkdir.C	(revision 13947)
+++ src/support/mkdir.C	(working copy)
@@ -22,6 +22,9 @@
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
+#ifdef HAVE_DIRECT_H
+# include <direct.h>
+#endif
 #ifdef _WIN32
 # include <windows.h>
 #endif
Index: src/support/package.C.in
===================================================================
--- src/support/package.C.in	(revision 13947)
+++ src/support/package.C.in	(working copy)
@@ -44,6 +44,10 @@
 # include <CoreServices/CoreServices.h> // FSFindFolder, FSRefMakePath
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 512
+#endif
+
 using std::string;
 
 namespace fs = boost::filesystem;





Reply via email to