aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/os.c1
-rw-r--r--src/os.h5
-rw-r--r--src/tclsqlite.c28
3 files changed, 21 insertions, 13 deletions
diff --git a/src/os.c b/src/os.c
index 77f541864..bc65ae32b 100644
--- a/src/os.c
+++ b/src/os.c
@@ -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
diff --git a/src/os.h b/src/os.h
index e7637fbca..006ed5e13 100644
--- a/src/os.h
+++ b/src/os.h
@@ -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) */