From 662df7811a57be50657f5c710bd1141c69cc1d16 Mon Sep 17 00:00:00 2001 From: Sandrine Avakian Date: Thu, 19 May 2016 17:51:10 +0200 Subject: [PATCH] Windows build fix. --- coreapi/lpconfig.c | 2 +- coreapi/sqlite3_bctbx_vfs.c | 8 ++++++-- coreapi/sqlite3_bctbx_vfs.h | 4 +--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/coreapi/lpconfig.c b/coreapi/lpconfig.c index c37a8ae54..131378cc0 100644 --- a/coreapi/lpconfig.c +++ b/coreapi/lpconfig.c @@ -437,7 +437,7 @@ LpConfig *lp_config_new_with_factory(const char *config_filename, const char *fa #ifdef RENAME_REQUIRES_NONEXISTENT_NEW_PATH if (fd == -1){ - pFile = bctbx_file_open(lpconfig->g_bctbx_vfs,lpconfig->tmpfilename, "r+"); + pFile = bctbx_filecreate_and_open(lpconfig->g_bctbx_vfs,lpconfig->tmpfilename, "r+"); if (fd){ ms_warning("Could not open %s but %s works, app may have crashed during last sync.",lpconfig->filename,lpconfig->tmpfilename); } diff --git a/coreapi/sqlite3_bctbx_vfs.c b/coreapi/sqlite3_bctbx_vfs.c index 8e3bda01e..4128062dc 100644 --- a/coreapi/sqlite3_bctbx_vfs.c +++ b/coreapi/sqlite3_bctbx_vfs.c @@ -19,9 +19,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "sqlite3_bctbx_vfs.h" -#include #include +#ifndef _WIN32_WCE +#include +#endif /*_WIN32_WCE*/ + + /** * Closes the file whose file descriptor is stored in the file handle p. @@ -248,7 +252,7 @@ static int sqlite3bctbx_Open(sqlite3_vfs *pVfs, const char *fName, sqlite3_file } /* Set flags to open the file with */ - if( flags&SQLITE_OPEN_EXCLUSIVE ) openFlags |= (O_EXCL|O_NOFOLLOW); + if( flags&SQLITE_OPEN_EXCLUSIVE ) openFlags |= O_EXCL; if( flags&SQLITE_OPEN_CREATE ) openFlags |= O_CREAT; if( flags&SQLITE_OPEN_READONLY ) openFlags |= O_RDONLY; if( flags&SQLITE_OPEN_READWRITE ) openFlags |= O_RDWR; diff --git a/coreapi/sqlite3_bctbx_vfs.h b/coreapi/sqlite3_bctbx_vfs.h index 497b84e27..001c1b142 100644 --- a/coreapi/sqlite3_bctbx_vfs.h +++ b/coreapi/sqlite3_bctbx_vfs.h @@ -21,14 +21,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#include -#include #include -#include #include "sqlite3.h" #include + /* ** The maximum pathname length supported by this VFS. */