diff options
author | drh <drh@noemail.net> | 2007-04-05 21:58:33 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2007-04-05 21:58:33 +0000 |
commit | bd08af48710c7ecf7783847b75cf7bf39a7651a6 (patch) | |
tree | caead637e9a58c01e6621f3f343b475c92b478fa /src | |
parent | 93d57531f7744c2422de8cfb63a9bda90a41dbf3 (diff) | |
download | sqlite-bd08af48710c7ecf7783847b75cf7bf39a7651a6.tar.gz sqlite-bd08af48710c7ecf7783847b75cf7bf39a7651a6.zip |
Fix the amalgamation so that it works with -DSQLITE_ENABLE_REDEF_IO. Change
tclsqlite.c so that it can be appended to the amalgamation. Create a new
amalgamation of header files for use by projects that want to redefine their
own I/O interface using -DSQLITE_ENABLE_REDEF_IO. (CVS 3817)
FossilOrigin-Name: f2caff870c81c08ec85aae72986c231ee986b251
Diffstat (limited to 'src')
-rw-r--r-- | src/os.c | 1 | ||||
-rw-r--r-- | src/os.h | 5 | ||||
-rw-r--r-- | src/tclsqlite.c | 28 |
3 files changed, 21 insertions, 13 deletions
@@ -16,6 +16,7 @@ #define _SQLITE_OS_C_ 1 #include "sqliteInt.h" #include "os.h" +#undef _SQLITE_OS_C_ /* ** The following routines are convenience wrappers around methods @@ -447,9 +447,12 @@ struct sqlite3OsVtbl { #endif -#ifdef _SQLITE_OS_C_ +#if defined(_SQLITE_OS_C_) || defined(SQLITE_AMALGAMATION) /* ** The os.c file implements the global virtual function table. + ** We have to put this file here because the initializers + ** (ex: sqlite3OsRandomSeed) are macros that are about to be + ** redefined. */ struct sqlite3OsVtbl sqlite3Os = { IF_DISKIO( sqlite3OsOpenReadWrite ), diff --git a/src/tclsqlite.c b/src/tclsqlite.c index cc1f624f7..e7b2ac467 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -9,19 +9,25 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** A TCL Interface to SQLite +** A TCL Interface to SQLite. Append this file to sqlite3.c and +** compile the whole thing to build a TCL-enabled version of SQLite. ** -** $Id: tclsqlite.c,v 1.177 2007/03/29 12:19:12 danielk1977 Exp $ +** $Id: tclsqlite.c,v 1.178 2007/04/05 21:58:33 drh Exp $ */ -#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */ - -#include "sqliteInt.h" -#include "hash.h" #include "tcl.h" -#include <stdlib.h> -#include <string.h> -#include <assert.h> -#include <ctype.h> + +/* +** Some additional include files are needed if this file is not +** appended to the amalgamation. +*/ +#ifndef SQLITE_AMALGAMATION +# include "sqliteInt.h" +# include "hash.h" +# include <stdlib.h> +# include <string.h> +# include <assert.h> +# include <ctype.h> +#endif /* * Windows needs to know which symbols to export. Unix does not. @@ -2256,5 +2262,3 @@ int TCLSH_MAIN(int argc, char **argv){ return 0; } #endif /* TCLSH */ - -#endif /* !defined(NO_TCL) */ |