]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Enable the RBU extension to compile cleanly on Windows using MSVC.
authormistachkin <mistachkin@noemail.net>
Fri, 24 Jul 2015 21:19:25 +0000 (21:19 +0000)
committermistachkin <mistachkin@noemail.net>
Fri, 24 Jul 2015 21:19:25 +0000 (21:19 +0000)
FossilOrigin-Name: cca79fdc3dff65907c2a59369057265b4512058f

ext/rbu/rbu.c
ext/rbu/sqlite3rbu.c
manifest
manifest.uuid

index 6e84bbdebefbc6b8379cb50b6133c9483d3a0388..dd46743def7e6526c593d43c6c6525d7dc18124b 100644 (file)
@@ -65,6 +65,7 @@ int main(int argc, char **argv){
   int i;
   const char *zTarget;            /* Target database to apply RBU to */
   const char *zRbu;               /* Database containing RBU */
+  char zBuf[200];                 /* Buffer for printf() */
   char *zErrmsg;                  /* Error message, if any */
   sqlite3rbu *pRbu;               /* RBU handle */
   int nStep = 0;                  /* Maximum number of step() calls */
@@ -98,17 +99,19 @@ int main(int argc, char **argv){
   /* Let the user know what happened. */
   switch( rc ){
     case SQLITE_OK:
-      fprintf(stdout, 
+      sqlite3_snprintf(sizeof(zBuf), zBuf,
           "SQLITE_OK: rbu update incomplete (%lld operations so far)\n",
           nProgress
       );
+      fprintf(stdout, zBuf);
       break;
 
     case SQLITE_DONE:
-      fprintf(stdout, 
+      sqlite3_snprintf(sizeof(zBuf), zBuf,
           "SQLITE_DONE: rbu update completed (%lld operations)\n",
           nProgress
       );
+      fprintf(stdout, zBuf);
       break;
 
     default:
index 93197e13def036bb88ee90ab473fc7e8c0deb098..491313ad9a3b3b20a5194f7c5a731932dc804ccc 100644 (file)
 #include <assert.h>
 #include <string.h>
 #include <stdio.h>
-#include <unistd.h>
+
+#if !defined(_WIN32)
+#  include <unistd.h>
+#endif
 
 #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, ...){
   va_list ap;
+  char *zSql;
   va_start(ap, zFmt);
-  char *zSql = sqlite3_vmprintf(zFmt, ap);
+  zSql = sqlite3_vmprintf(zFmt, ap);
   if( p->rc==SQLITE_OK ){
     if( zSql==0 ){
       p->rc = SQLITE_NOMEM;
@@ -2640,7 +2644,7 @@ static void rbuCreateVfs(sqlite3rbu *p){
 
   assert( p->rc==SQLITE_OK );
   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);
   if( p->rc==SQLITE_OK ){
     sqlite3_vfs *pVfs = sqlite3_vfs_find(zRnd);
@@ -3525,7 +3529,7 @@ static void (*rbuVfsDlSym(
 */
 static void rbuVfsDlClose(sqlite3_vfs *pVfs, void *pHandle){
   sqlite3_vfs *pRealVfs = ((rbu_vfs*)pVfs)->pRealVfs;
-  return pRealVfs->xDlClose(pRealVfs, pHandle);
+  pRealVfs->xDlClose(pRealVfs, pHandle);
 }
 #endif /* SQLITE_OMIT_LOAD_EXTENSION */
 
index 70c45547132bd4113aa43fc2d7ccf66e80919349..66be05909f21080ed4f2746dc34f792e526b4d72 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C For\sWindows\sCE,\sa\sdifferent\sheader\sis\srequired\sfor\sthe\sbyteswap\sintrinsics.
-D 2015-07-24T20:43:18.969
+C Enable\sthe\sRBU\sextension\sto\scompile\scleanly\son\sWindows\susing\sMSVC.
+D 2015-07-24T21:19:25.937
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 4de3ef40c8b3b75c0c55ff4242a43c8ce1ad90ee
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -200,7 +200,7 @@ F ext/misc/totype.c 4a167594e791abeed95e0a8db028822b5e8fe512
 F ext/misc/vfslog.c fe40fab5c077a40477f7e5eba994309ecac6cc95
 F ext/misc/vtshim.c babb0dc2bf116029e3e7c9a618b8a1377045303e
 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/rbu10.test 046b0980041d30700464a800bbf6733ed2df515d
 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/rbufault.test cc0be8d5d392d98b0c2d6a51be377ea989250a89
 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/test_rbu.c f99698956cc9158d6bf865e461e2d15876538ac1
 F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
@@ -1366,7 +1366,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P bd4f156d07d0db1f063d42891965920fc2229352
-R 2d59310b8a12a1f1c165b9fca130a928
+P 2d572b8cdc67679cc95e69677a87e7b4a82f6c2d
+R 7ad7b2938e518b64d413cdd1d26d7b2c
 U mistachkin
-Z 103ab03ee254c9c07747db619d6c6742
+Z 50750fa0b6e34b0305f7afdd413b595e
index b0d985e9121a9c9369580f16690a4f9f68b5af5c..d19a7ef222e0f62492f639722092382b53080a28 100644 (file)
@@ -1 +1 @@
-2d572b8cdc67679cc95e69677a87e7b4a82f6c2d
\ No newline at end of file
+cca79fdc3dff65907c2a59369057265b4512058f
\ No newline at end of file