Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Enable the RBU extension to compile cleanly on Windows using MSVC. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
cca79fdc3dff65907c2a59369057265b |
User & Date: | mistachkin 2015-07-24 21:19:25.937 |
Context
2015-07-24
| ||
23:28 | Fix the zeroblob.test script so that it works even on builds where the SQLITE_MAX_LENGTH has been raised to 2147483645. (check-in: db12914981 user: drh tags: trunk) | |
22:21 | Merge test improvements and minor fixes from trunk. (check-in: 0298a9a780 user: drh tags: sessions) | |
21:19 | Enable the RBU extension to compile cleanly on Windows using MSVC. (check-in: cca79fdc3d user: mistachkin tags: trunk) | |
20:43 | For Windows CE, a different header is required for the byteswap intrinsics. (check-in: 2d572b8cdc user: mistachkin tags: trunk) | |
Changes
Changes to ext/rbu/rbu.c.
︙ | ︙ | |||
61 62 63 64 65 66 67 68 69 70 71 72 73 74 | } } int main(int argc, char **argv){ int i; const char *zTarget; /* Target database to apply RBU to */ const char *zRbu; /* Database containing RBU */ char *zErrmsg; /* Error message, if any */ sqlite3rbu *pRbu; /* RBU handle */ int nStep = 0; /* Maximum number of step() calls */ int rc; sqlite3_int64 nProgress = 0; /* Process command line arguments. Following this block local variables | > | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | } } 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 */ int rc; sqlite3_int64 nProgress = 0; /* Process command line arguments. Following this block local variables |
︙ | ︙ | |||
94 95 96 97 98 99 100 | for(i=0; (nStep<=0 || i<nStep) && sqlite3rbu_step(pRbu)==SQLITE_OK; i++); nProgress = sqlite3rbu_progress(pRbu); rc = sqlite3rbu_close(pRbu, &zErrmsg); /* Let the user know what happened. */ switch( rc ){ case SQLITE_OK: | | > | > | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | for(i=0; (nStep<=0 || i<nStep) && sqlite3rbu_step(pRbu)==SQLITE_OK; i++); nProgress = sqlite3rbu_progress(pRbu); rc = sqlite3rbu_close(pRbu, &zErrmsg); /* Let the user know what happened. */ switch( rc ){ case SQLITE_OK: sqlite3_snprintf(sizeof(zBuf), zBuf, "SQLITE_OK: rbu update incomplete (%lld operations so far)\n", nProgress ); fprintf(stdout, zBuf); break; case SQLITE_DONE: sqlite3_snprintf(sizeof(zBuf), zBuf, "SQLITE_DONE: rbu update completed (%lld operations)\n", nProgress ); fprintf(stdout, zBuf); break; default: fprintf(stderr, "error=%d: %s\n", rc, zErrmsg); break; } sqlite3_free(zErrmsg); return (rc==SQLITE_OK || rc==SQLITE_DONE) ? 0 : 1; } |
Changes to ext/rbu/sqlite3rbu.c.
︙ | ︙ | |||
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | ** update database than is strictly necessary. ** */ #include <assert.h> #include <string.h> #include <stdio.h> #include <unistd.h> #include "sqlite3.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU) #include "sqlite3rbu.h" /* Maximum number of prepared UPDATE statements held by this module */ | > > > | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | ** update database than is strictly necessary. ** */ #include <assert.h> #include <string.h> #include <stdio.h> #if !defined(_WIN32) #include <unistd.h> #endif #include "sqlite3.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU) #include "sqlite3rbu.h" /* Maximum number of prepared UPDATE statements held by this module */ |
︙ | ︙ | |||
616 617 618 619 620 621 622 623 | ** ** If an error occurs, an error code and error message is stored in the ** RBU handle. If an error has already occurred when this function is ** called, it is a no-op. */ static int rbuMPrintfExec(sqlite3rbu *p, sqlite3 *db, const char *zFmt, ...){ va_list ap; va_start(ap, zFmt); | > | | 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 | ** ** If an error occurs, an error code and error message is stored in the ** RBU handle. If an error has already occurred when this function is ** called, it is a no-op. */ static int rbuMPrintfExec(sqlite3rbu *p, sqlite3 *db, const char *zFmt, ...){ va_list ap; char *zSql; va_start(ap, zFmt); zSql = sqlite3_vmprintf(zFmt, ap); if( p->rc==SQLITE_OK ){ if( zSql==0 ){ p->rc = SQLITE_NOMEM; }else{ p->rc = sqlite3_exec(db, zSql, 0, 0, &p->zErrmsg); } } |
︙ | ︙ | |||
2636 2637 2638 2639 2640 2641 2642 | */ static void rbuCreateVfs(sqlite3rbu *p){ int rnd; char zRnd[64]; assert( p->rc==SQLITE_OK ); sqlite3_randomness(sizeof(int), (void*)&rnd); | | | 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 | */ static void rbuCreateVfs(sqlite3rbu *p){ int rnd; char zRnd[64]; assert( p->rc==SQLITE_OK ); sqlite3_randomness(sizeof(int), (void*)&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); assert( pVfs ); p->zVfsName = pVfs->zName; } } |
︙ | ︙ | |||
3521 3522 3523 3524 3525 3526 3527 | } /* ** Close the dynamic library handle pHandle. */ static void rbuVfsDlClose(sqlite3_vfs *pVfs, void *pHandle){ sqlite3_vfs *pRealVfs = ((rbu_vfs*)pVfs)->pRealVfs; | | | 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 | } /* ** Close the dynamic library handle pHandle. */ static void rbuVfsDlClose(sqlite3_vfs *pVfs, void *pHandle){ sqlite3_vfs *pRealVfs = ((rbu_vfs*)pVfs)->pRealVfs; pRealVfs->xDlClose(pRealVfs, pHandle); } #endif /* SQLITE_OMIT_LOAD_EXTENSION */ /* ** Populate the buffer pointed to by zBufOut with nByte bytes of ** random data. */ |
︙ | ︙ |