From a21c78f25b08783b71f114d54c6ae0f9ba7d6045 Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Mon, 29 May 2006 14:56:08 +0000 Subject: [PATCH] Some MSVC2003/2005 compatibility fixes, from Bo Peng (ben.bob@gmail.com) * src/support/lyxsum.C: fix HAVE_DECL_ISTREAMBUF_ITERATOR * src/support/mkdir.C: add direct.h for windows * src/support/forkedcall.C: add cerrno under windows * src/support/tempname.C: define S_IRUSR and S_IWUSR * src/support/package.C.in: define PATH_MAX=256 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13951 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/BulletsModule.C | 2 ++ src/support/forkedcall.C | 2 +- src/support/lyxsum.C | 2 +- src/support/mkdir.C | 3 +++ src/support/package.C.in | 4 ++++ src/support/tempname.C | 4 ++++ 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/BulletsModule.C b/src/frontends/qt4/BulletsModule.C index a23d3934e0..54b85691ed 100644 --- a/src/frontends/qt4/BulletsModule.C +++ b/src/frontends/qt4/BulletsModule.C @@ -250,6 +250,8 @@ QPixmap BulletsModule::getPixmap(int font, int character) default: return standard_->pixmap(row,col); }*/ + // make qt4 frontend at least compilable now. + return QPixmap(); } diff --git a/src/support/forkedcall.C b/src/support/forkedcall.C index e37e49d9d6..e1d5ef50cf 100644 --- a/src/support/forkedcall.C +++ b/src/support/forkedcall.C @@ -38,6 +38,7 @@ #include #include +#include #ifdef _WIN32 # define SIGHUP 1 @@ -46,7 +47,6 @@ # include #else -# include # include # include # ifdef HAVE_UNISTD_H diff --git a/src/support/lyxsum.C b/src/support/lyxsum.C index d14ea24d7d..b9cee3289b 100644 --- a/src/support/lyxsum.C +++ b/src/support/lyxsum.C @@ -103,8 +103,8 @@ unsigned long do_crc(InputIterator first, InputIterator last) } // namespace -#if HAVE_DECL_ISTREAMBUF_ITERATOR using std::ifstream; +#if HAVE_DECL_ISTREAMBUF_ITERATOR using std::istreambuf_iterator; unsigned long lyx::support::sum(string const & file) diff --git a/src/support/mkdir.C b/src/support/mkdir.C index 5d91b713bb..ddea3dd604 100644 --- a/src/support/mkdir.C +++ b/src/support/mkdir.C @@ -22,6 +22,9 @@ #ifdef HAVE_UNISTD_H # include #endif +#ifdef HAVE_DIRECT_H +# include +#endif #ifdef _WIN32 # include #endif diff --git a/src/support/package.C.in b/src/support/package.C.in index 6810a5509f..86bcd69582 100644 --- a/src/support/package.C.in +++ b/src/support/package.C.in @@ -44,6 +44,10 @@ # include // FSFindFolder, FSRefMakePath #endif +#ifndef PATH_MAX +# define PATH_MAX 256 +#endif + using std::string; namespace fs = boost::filesystem; diff --git a/src/support/tempname.C b/src/support/tempname.C index 54833b5b47..86f968d58b 100644 --- a/src/support/tempname.C +++ b/src/support/tempname.C @@ -54,6 +54,10 @@ int make_tempfile(char * templ) // 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, -- 2.39.2