1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Enable the RBU extension to compile cleanly on Windows using MSVC.

FossilOrigin-Name: cca79fdc3dff65907c2a59369057265b4512058f
This commit is contained in:
mistachkin
2015-07-24 21:19:25 +00:00
parent 9895f73526
commit 24fa5435ee
4 changed files with 21 additions and 14 deletions

View File

@ -65,6 +65,7 @@ int main(int argc, char **argv){
int i; int i;
const char *zTarget; /* Target database to apply RBU to */ const char *zTarget; /* Target database to apply RBU to */
const char *zRbu; /* Database containing RBU */ const char *zRbu; /* Database containing RBU */
char zBuf[200]; /* Buffer for printf() */
char *zErrmsg; /* Error message, if any */ char *zErrmsg; /* Error message, if any */
sqlite3rbu *pRbu; /* RBU handle */ sqlite3rbu *pRbu; /* RBU handle */
int nStep = 0; /* Maximum number of step() calls */ int nStep = 0; /* Maximum number of step() calls */
@ -98,17 +99,19 @@ int main(int argc, char **argv){
/* Let the user know what happened. */ /* Let the user know what happened. */
switch( rc ){ switch( rc ){
case SQLITE_OK: case SQLITE_OK:
fprintf(stdout, sqlite3_snprintf(sizeof(zBuf), zBuf,
"SQLITE_OK: rbu update incomplete (%lld operations so far)\n", "SQLITE_OK: rbu update incomplete (%lld operations so far)\n",
nProgress nProgress
); );
fprintf(stdout, zBuf);
break; break;
case SQLITE_DONE: case SQLITE_DONE:
fprintf(stdout, sqlite3_snprintf(sizeof(zBuf), zBuf,
"SQLITE_DONE: rbu update completed (%lld operations)\n", "SQLITE_DONE: rbu update completed (%lld operations)\n",
nProgress nProgress
); );
fprintf(stdout, zBuf);
break; break;
default: default:

View File

@ -83,7 +83,10 @@
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h>
#if !defined(_WIN32)
# include <unistd.h>
#endif
#include "sqlite3.h" #include "sqlite3.h"
@ -620,8 +623,9 @@ static char *rbuMPrintf(sqlite3rbu *p, const char *zFmt, ...){
*/ */
static int rbuMPrintfExec(sqlite3rbu *p, sqlite3 *db, const char *zFmt, ...){ static int rbuMPrintfExec(sqlite3rbu *p, sqlite3 *db, const char *zFmt, ...){
va_list ap; va_list ap;
char *zSql;
va_start(ap, zFmt); va_start(ap, zFmt);
char *zSql = sqlite3_vmprintf(zFmt, ap); zSql = sqlite3_vmprintf(zFmt, ap);
if( p->rc==SQLITE_OK ){ if( p->rc==SQLITE_OK ){
if( zSql==0 ){ if( zSql==0 ){
p->rc = SQLITE_NOMEM; p->rc = SQLITE_NOMEM;
@ -2640,7 +2644,7 @@ static void rbuCreateVfs(sqlite3rbu *p){
assert( p->rc==SQLITE_OK ); assert( p->rc==SQLITE_OK );
sqlite3_randomness(sizeof(int), (void*)&rnd); sqlite3_randomness(sizeof(int), (void*)&rnd);
sprintf(zRnd, "rbu_vfs_%d", rnd); sqlite3_snprintf(sizeof(zRnd), zRnd, "rbu_vfs_%d", rnd);
p->rc = sqlite3rbu_create_vfs(zRnd, 0); p->rc = sqlite3rbu_create_vfs(zRnd, 0);
if( p->rc==SQLITE_OK ){ if( p->rc==SQLITE_OK ){
sqlite3_vfs *pVfs = sqlite3_vfs_find(zRnd); sqlite3_vfs *pVfs = sqlite3_vfs_find(zRnd);
@ -3525,7 +3529,7 @@ static void (*rbuVfsDlSym(
*/ */
static void rbuVfsDlClose(sqlite3_vfs *pVfs, void *pHandle){ static void rbuVfsDlClose(sqlite3_vfs *pVfs, void *pHandle){
sqlite3_vfs *pRealVfs = ((rbu_vfs*)pVfs)->pRealVfs; sqlite3_vfs *pRealVfs = ((rbu_vfs*)pVfs)->pRealVfs;
return pRealVfs->xDlClose(pRealVfs, pHandle); pRealVfs->xDlClose(pRealVfs, pHandle);
} }
#endif /* SQLITE_OMIT_LOAD_EXTENSION */ #endif /* SQLITE_OMIT_LOAD_EXTENSION */

View File

@ -1,5 +1,5 @@
C For\sWindows\sCE,\sa\sdifferent\sheader\sis\srequired\sfor\sthe\sbyteswap\sintrinsics. C Enable\sthe\sRBU\sextension\sto\scompile\scleanly\son\sWindows\susing\sMSVC.
D 2015-07-24T20:43:18.969 D 2015-07-24T21:19:25.937
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 4de3ef40c8b3b75c0c55ff4242a43c8ce1ad90ee F Makefile.in 4de3ef40c8b3b75c0c55ff4242a43c8ce1ad90ee
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -200,7 +200,7 @@ F ext/misc/totype.c 4a167594e791abeed95e0a8db028822b5e8fe512
F ext/misc/vfslog.c fe40fab5c077a40477f7e5eba994309ecac6cc95 F ext/misc/vfslog.c fe40fab5c077a40477f7e5eba994309ecac6cc95
F ext/misc/vtshim.c babb0dc2bf116029e3e7c9a618b8a1377045303e F ext/misc/vtshim.c babb0dc2bf116029e3e7c9a618b8a1377045303e
F ext/misc/wholenumber.c 784b12543d60702ebdd47da936e278aa03076212 F ext/misc/wholenumber.c 784b12543d60702ebdd47da936e278aa03076212
F ext/rbu/rbu.c e04e7baea76b6dd719a4f290f8a58166efc8d234 F ext/rbu/rbu.c e572f7ddef2ef3a73d03e7b44d36448e466772b7
F ext/rbu/rbu1.test 57601977588603e82700a43c279bd55282ffa482 F ext/rbu/rbu1.test 57601977588603e82700a43c279bd55282ffa482
F ext/rbu/rbu10.test 046b0980041d30700464a800bbf6733ed2df515d F ext/rbu/rbu10.test 046b0980041d30700464a800bbf6733ed2df515d
F ext/rbu/rbu11.test 9bc68c2d3dbeb1720153626e3bd0466dcc017702 F ext/rbu/rbu11.test 9bc68c2d3dbeb1720153626e3bd0466dcc017702
@ -217,7 +217,7 @@ F ext/rbu/rbuA.test c1a7b3e2d926b8f8448bb3b4ae787e314ee4b2b3
F ext/rbu/rbucrash.test 8d2ed5d4b05fef6c00c2a6b5f7ead71fa172a695 F ext/rbu/rbucrash.test 8d2ed5d4b05fef6c00c2a6b5f7ead71fa172a695
F ext/rbu/rbufault.test cc0be8d5d392d98b0c2d6a51be377ea989250a89 F ext/rbu/rbufault.test cc0be8d5d392d98b0c2d6a51be377ea989250a89
F ext/rbu/rbufault2.test 9a7f19edd6ea35c4c9f807d8a3db0a03a5670c06 F ext/rbu/rbufault2.test 9a7f19edd6ea35c4c9f807d8a3db0a03a5670c06
F ext/rbu/sqlite3rbu.c 7a0ca8fca2d0c9a72f0b7b96618c2ea9f7b4bc1d F ext/rbu/sqlite3rbu.c dbd7e4b31821398dcdeb21492970401ff1027881
F ext/rbu/sqlite3rbu.h 6a280298e9eeb8ef59841a620f07f4f844651545 F ext/rbu/sqlite3rbu.h 6a280298e9eeb8ef59841a620f07f4f844651545
F ext/rbu/test_rbu.c f99698956cc9158d6bf865e461e2d15876538ac1 F ext/rbu/test_rbu.c f99698956cc9158d6bf865e461e2d15876538ac1
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761 F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
@ -1366,7 +1366,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P bd4f156d07d0db1f063d42891965920fc2229352 P 2d572b8cdc67679cc95e69677a87e7b4a82f6c2d
R 2d59310b8a12a1f1c165b9fca130a928 R 7ad7b2938e518b64d413cdd1d26d7b2c
U mistachkin U mistachkin
Z 103ab03ee254c9c07747db619d6c6742 Z 50750fa0b6e34b0305f7afdd413b595e

View File

@ -1 +1 @@
2d572b8cdc67679cc95e69677a87e7b4a82f6c2d cca79fdc3dff65907c2a59369057265b4512058f