1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

More cleanup, etc. to support MSVC compiles. (CVS 6582)

FossilOrigin-Name: 2cd9655e7313671f2bbe8d4a6f13246cbbf61205
This commit is contained in:
shane
2009-04-30 17:45:33 +00:00
parent 0038e0c08f
commit eb4ac06f4e
3 changed files with 19 additions and 13 deletions

View File

@ -10,7 +10,7 @@
** **
************************************************************************* *************************************************************************
** **
** $Id: sqlite3async.c,v 1.5 2009/04/29 18:12:00 shane Exp $ ** $Id: sqlite3async.c,v 1.6 2009/04/30 17:45:34 shane Exp $
** **
** This file contains the implementation of an asynchronous IO backend ** This file contains the implementation of an asynchronous IO backend
** for SQLite. ** for SQLite.
@ -19,7 +19,7 @@
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ASYNCIO) #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ASYNCIO)
#include "sqlite3async.h" #include "sqlite3async.h"
#include "sqliteInt.h" #include "sqlite3.h"
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
@ -28,6 +28,11 @@
#define MIN(x,y) ((x)<(y)?(x):(y)) #define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)>(y)?(x):(y)) #define MAX(x,y) ((x)>(y)?(x):(y))
#ifndef SQLITE_AMALGAMATION
/* Macro to mark parameters as unused and silence compiler warnings. */
#define UNUSED_PARAMETER(x) (void)(x)
#endif
/* Forward references */ /* Forward references */
typedef struct AsyncWrite AsyncWrite; typedef struct AsyncWrite AsyncWrite;
typedef struct AsyncFile AsyncFile; typedef struct AsyncFile AsyncFile;
@ -242,6 +247,8 @@ static void async_os_shutdown(void);
*/ */
#if SQLITE_OS_WIN || defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__) #if SQLITE_OS_WIN || defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__)
#include <windows.h>
/* The following block contains the win32 specific code. */ /* The following block contains the win32 specific code. */
#define mutex_held(X) (GetCurrentThreadId()==primitives.aHolder[X]) #define mutex_held(X) (GetCurrentThreadId()==primitives.aHolder[X])
@ -302,7 +309,6 @@ static void async_cond_signal(int eCond){
SetEvent(primitives.aCond[eCond]); SetEvent(primitives.aCond[eCond]);
} }
static void async_sched_yield(void){ static void async_sched_yield(void){
/* Todo: Find out if win32 offers anything like sched_yield() */
Sleep(0); Sleep(0);
} }
#else #else
@ -703,7 +709,7 @@ static int asyncRead(
if( iBeginIn<0 ) iBeginIn = 0; if( iBeginIn<0 ) iBeginIn = 0;
if( iBeginOut<0 ) iBeginOut = 0; if( iBeginOut<0 ) iBeginOut = 0;
nCopy = MIN(pWrite->nByte-iBeginIn, iAmt-iBeginOut); nCopy = (int)MIN(pWrite->nByte-iBeginIn, iAmt-iBeginOut);
if( nCopy>0 ){ if( nCopy>0 ){
memcpy(&((char *)zOut)[iBeginOut], &pWrite->zBuf[iBeginIn], nCopy); memcpy(&((char *)zOut)[iBeginOut], &pWrite->zBuf[iBeginIn], nCopy);
@ -751,7 +757,7 @@ int asyncFileSize(sqlite3_file *pFile, sqlite3_int64 *piSize){
async_mutex_enter(ASYNC_MUTEX_QUEUE); async_mutex_enter(ASYNC_MUTEX_QUEUE);
/* Read the filesystem size from the base file. If pBaseRead is NULL, this /* Read the filesystem size from the base file. If pMethods is NULL, this
** means the file hasn't been opened yet. In this case all relevant data ** means the file hasn't been opened yet. In this case all relevant data
** must be in the write-op queue anyway, so we can omit reading from the ** must be in the write-op queue anyway, so we can omit reading from the
** file-system. ** file-system.

View File

@ -1,5 +1,5 @@
C Disable\san\salways-false\stest\sin\sthe\sattach.c\smodule.\s(CVS\s6581) C More\scleanup,\setc.\sto\ssupport\sMSVC\scompiles.\s(CVS\s6582)
D 2009-04-30T17:38:38 D 2009-04-30T17:45:34
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 583e87706abc3026960ed759aff6371faf84c211 F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -25,7 +25,7 @@ F doc/lemon.html f0f682f50210928c07e562621c3b7e8ab912a538
F doc/report1.txt a031aaf37b185e4fa540223cb516d3bccec7eeac F doc/report1.txt a031aaf37b185e4fa540223cb516d3bccec7eeac
F ext/README.txt 913a7bd3f4837ab14d7e063304181787658b14e1 F ext/README.txt 913a7bd3f4837ab14d7e063304181787658b14e1
F ext/async/README.txt 0c541f418b14b415212264cbaaf51c924ec62e5b F ext/async/README.txt 0c541f418b14b415212264cbaaf51c924ec62e5b
F ext/async/sqlite3async.c 207af6692a52cf1dc3a9e64c93dcd7f7a7db0a6f F ext/async/sqlite3async.c a10dd8add8544c62faf1b6eccb6b1e535b5e7cad
F ext/async/sqlite3async.h b6d74dbf9aa5a0ac4e79aa15a4d987f3552a0f75 F ext/async/sqlite3async.h b6d74dbf9aa5a0ac4e79aa15a4d987f3552a0f75
F ext/fts1/README.txt 20ac73b006a70bcfd80069bdaf59214b6cf1db5e F ext/fts1/README.txt 20ac73b006a70bcfd80069bdaf59214b6cf1db5e
F ext/fts1/ft_hash.c 3927bd880e65329bdc6f506555b228b28924921b F ext/fts1/ft_hash.c 3927bd880e65329bdc6f506555b228b28924921b
@ -726,7 +726,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
P d67af3f5a21329e133aa6cf2be745a9f8c1a6562 P 92b69481bd0eedf06599c40623b38a6f4990010a
R 1053ef59038cf5f36f9be3b18c891400 R 1fb8411f09203d4b0b597f4bb4bb4448
U drh U shane
Z f5c5a2a7db3916e075df663b238c5cc6 Z c3fcacee57f0e52fd4f695bca1750e29

View File

@ -1 +1 @@
92b69481bd0eedf06599c40623b38a6f4990010a 2cd9655e7313671f2bbe8d4a6f13246cbbf61205