diff options
author | drh <drh@noemail.net> | 2015-11-19 19:40:40 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-11-19 19:40:40 +0000 |
commit | 769dc6e2a22b3104583ad357b01f31a22e146a5c (patch) | |
tree | f88612242437ec891ead4c010c94a20b1d4587ee /src/os_win.c | |
parent | 98a0e0083f33ae62a8104be5c074daa123cffc84 (diff) | |
parent | 18f8e73453be7c7a2394824739e890a4d4e8cad0 (diff) | |
download | sqlite-769dc6e2a22b3104583ad357b01f31a22e146a5c.tar.gz sqlite-769dc6e2a22b3104583ad357b01f31a22e146a5c.zip |
Merge the latest enhancements from trunk.
FossilOrigin-Name: 7d6cfc79e7e5534ebacd980479917bc528a638f7
Diffstat (limited to 'src/os_win.c')
-rw-r--r-- | src/os_win.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/os_win.c b/src/os_win.c index 251107528..9ae40e22a 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -2602,7 +2602,7 @@ static int winWrite( "offset=%lld, lock=%d\n", osGetCurrentProcessId(), pFile, pFile->h, pBuf, amt, offset, pFile->locktype)); -#if SQLITE_MAX_MMAP_SIZE>0 +#if defined(SQLITE_MMAP_READWRITE) && SQLITE_MAX_MMAP_SIZE>0 /* Deal with as much of this write request as possible by transfering ** data from the memory mapping using memcpy(). */ if( offset<pFile->mmapSize ){ @@ -4096,10 +4096,12 @@ static int winMapfile(winFile *pFd, sqlite3_int64 nByte){ DWORD flags = FILE_MAP_READ; winUnmapfile(pFd); +#ifdef SQLITE_MMAP_READWRITE if( (pFd->ctrlFlags & WINFILE_RDONLY)==0 ){ protect = PAGE_READWRITE; flags |= FILE_MAP_WRITE; } +#endif #if SQLITE_OS_WINRT pFd->hMap = osCreateFileMappingFromApp(pFd->h, NULL, protect, nMap, NULL); #elif defined(SQLITE_WIN32_HAS_WIDE) |