Index: src/main.c ================================================================== --- src/main.c +++ src/main.c @@ -53,10 +53,23 @@ ** zero if and only if SQLite was compiled with mutexing code omitted due to ** the SQLITE_THREADSAFE compile-time option being set to 0. */ int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; } +/* +** When compiling the test fixture or with debugging enabled (on Win32), +** this variable being set to non-zero will cause OSTRACE macros to emit +** extra diagnostic information. +*/ +#if (defined(SQLITE_DEBUG) && SQLITE_OS_WIN) || \ + (defined(SQLITE_TEST) || defined(SQLITE_FORCE_OS_TRACE)) +# ifndef SQLITE_DEBUG_OS_TRACE +# define SQLITE_DEBUG_OS_TRACE 0 +# endif + int sqlite3OSTrace = SQLITE_DEBUG_OS_TRACE; +#endif + #if !defined(SQLITE_OMIT_TRACE) && defined(SQLITE_ENABLE_IOTRACE) /* ** If the following function pointer is not NULL and if ** SQLITE_ENABLE_IOTRACE is enabled, then messages describing ** I/O active are written using this function. These messages Index: src/os_common.h ================================================================== --- src/os_common.h +++ src/os_common.h @@ -27,16 +27,16 @@ */ #ifdef MEMORY_DEBUG # error "The MEMORY_DEBUG macro is obsolete. Use SQLITE_DEBUG instead." #endif +/* +** Declarations used for tracing the operating system interfaces. +*/ #if (defined(SQLITE_DEBUG) && SQLITE_OS_WIN) || \ (defined(SQLITE_TEST) || defined(SQLITE_FORCE_OS_TRACE)) -# ifndef SQLITE_DEBUG_OS_TRACE -# define SQLITE_DEBUG_OS_TRACE 0 -# endif - int sqlite3OSTrace = SQLITE_DEBUG_OS_TRACE; + extern int sqlite3OSTrace; # define OSTRACE(X) if( sqlite3OSTrace ) sqlite3DebugPrintf X #else # define OSTRACE(X) #endif