aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/global.c14
-rw-r--r--src/os_unix.c3
-rw-r--r--src/sqliteInt.h12
-rw-r--r--src/test_config.c20
4 files changed, 30 insertions, 19 deletions
diff --git a/src/global.c b/src/global.c
index cac48a860..e05168362 100644
--- a/src/global.c
+++ b/src/global.c
@@ -12,7 +12,7 @@
**
** This file contains definitions of global variables and contants.
**
-** $Id: global.c,v 1.7 2008/09/01 18:34:20 danielk1977 Exp $
+** $Id: global.c,v 1.8 2008/09/04 17:17:39 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -67,12 +67,12 @@ const unsigned char sqlite3UpperToLower[] = {
** the SQLite library.
*/
SQLITE_WSD struct Sqlite3Config sqlite3Config = {
- 1, /* bMemstat */
- 1, /* bCoreMutex */
- 1, /* bFullMutex */
- 0x7ffffffe, /* mxStrlen */
- 100, /* szLookaside */
- 500, /* nLookaside */
+ SQLITE_DEFAULT_MEMSTATUS, /* bMemstat */
+ 1, /* bCoreMutex */
+ SQLITE_THREADSAFE==1, /* bFullMutex */
+ 0x7ffffffe, /* mxStrlen */
+ 100, /* szLookaside */
+ 500, /* nLookaside */
/* Other fields all default to zero */
};
diff --git a/src/os_unix.c b/src/os_unix.c
index 45625ffe6..cd8cd521c 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -12,7 +12,7 @@
**
** This file contains code that is specific to Unix systems.
**
-** $Id: os_unix.c,v 1.199 2008/09/04 06:22:26 danielk1977 Exp $
+** $Id: os_unix.c,v 1.200 2008/09/04 17:17:39 danielk1977 Exp $
*/
#include "sqliteInt.h"
#if SQLITE_OS_UNIX /* This file is used on unix only */
@@ -2030,7 +2030,6 @@ static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){
static int flockLock(sqlite3_file *id, int locktype) {
int rc = SQLITE_OK;
- int lrc;
unixFile *pFile = (unixFile*)id;
assert( pFile );
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 75ae5293f..29a8efe70 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
-** @(#) $Id: sqliteInt.h,v 1.770 2008/09/04 04:32:49 shane Exp $
+** @(#) $Id: sqliteInt.h,v 1.771 2008/09/04 17:17:39 danielk1977 Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_
@@ -158,6 +158,16 @@
#endif
/*
+** The SQLITE_DEFAULT_MEMSTATUS macro must be defined as either 0 or 1.
+** It determines whether or not the features related to
+** SQLITE_CONFIG_MEMSTATUS are availabe by default or not. This value can
+** be overridden at runtime using the sqlite3_config() API.
+*/
+#if !defined(SQLITE_DEFAULT_MEMSTATUS)
+# define SQLITE_DEFAULT_MEMSTATUS 1
+#endif
+
+/*
** Exactly one of the following macros must be defined in order to
** specify which memory allocation subsystem to use.
**
diff --git a/src/test_config.c b/src/test_config.c
index 1a2870d60..e6ca83c0d 100644
--- a/src/test_config.c
+++ b/src/test_config.c
@@ -16,7 +16,7 @@
** The focus of this file is providing the TCL testing layer
** access to compile-time constants.
**
-** $Id: test_config.c,v 1.34 2008/09/02 00:52:52 drh Exp $
+** $Id: test_config.c,v 1.35 2008/09/04 17:17:39 danielk1977 Exp $
*/
#include "sqliteLimit.h"
@@ -27,6 +27,13 @@
#include <string.h>
/*
+** Macro to stringify the results of the evaluation a pre-processor
+** macro. i.e. so that STRINGVALUE(SQLITE_NOMEM) -> "7".
+*/
+#define STRINGVALUE2(x) #x
+#define STRINGVALUE(x) STRINGVALUE2(x)
+
+/*
** This routine sets entries in the global ::sqlite_options() array variable
** according to the compile-time configuration of the database. Test
** procedures use this to determine when tests should be omitted.
@@ -386,14 +393,9 @@ Tcl_SetVar2(interp, "sqlite_options", "long_double",
Tcl_SetVar2(interp, "sqlite_options", "tclvar", "1", TCL_GLOBAL_ONLY);
#endif
- rc = sqlite3_threadsafe();
-#if SQLITE_THREADSAFE
- Tcl_SetVar2(interp, "sqlite_options", "threadsafe", "1", TCL_GLOBAL_ONLY);
- assert( rc );
-#else
- Tcl_SetVar2(interp, "sqlite_options", "threadsafe", "0", TCL_GLOBAL_ONLY);
- assert( !rc );
-#endif
+ Tcl_SetVar2(interp, "sqlite_options", "threadsafe",
+ STRINGVALUE(SQLITE_THREADSAFE), TCL_GLOBAL_ONLY);
+ assert( sqlite3_threadsafe()==SQLITE_THREADSAFE );
#ifdef SQLITE_OMIT_TRACE
Tcl_SetVar2(interp, "sqlite_options", "trace", "0", TCL_GLOBAL_ONLY);