1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Add support for the SQLITE_THREADSAFE=2 and SQLITE_DEFAULT_MEMSTATUS compilation options. (CVS 5676)

FossilOrigin-Name: 85c2a58901338c1c4652c2cbee51e5f48d289191
This commit is contained in:
danielk1977
2008-09-04 17:17:38 +00:00
parent 145834a44f
commit 0a732f59b0
6 changed files with 41 additions and 30 deletions

View File

@@ -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"
@@ -26,6 +26,13 @@
#include <stdlib.h>
#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
@@ -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);