aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c2
-rw-r--r--src/os_common.h2
-rw-r--r--src/os_win.c12
-rw-r--r--src/printf.c3
-rw-r--r--src/sqliteInt.h2
5 files changed, 15 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 46823a2d9..0e2f2bdc0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1194,7 +1194,7 @@ void sqlite3RollbackAll(sqlite3 *db, int tripCode){
** Return a static string containing the name corresponding to the error code
** specified in the argument.
*/
-#if defined(SQLITE_DEBUG) && \
+#if (defined(SQLITE_DEBUG) && SQLITE_OS_WIN) || \
(defined(SQLITE_TEST) || defined(SQLITE_FORCE_OS_TRACE))
const char *sqlite3ErrName(int rc){
const char *zName = 0;
diff --git a/src/os_common.h b/src/os_common.h
index b5ecb9bbf..0f5f77943 100644
--- a/src/os_common.h
+++ b/src/os_common.h
@@ -29,7 +29,7 @@
# error "The MEMORY_DEBUG macro is obsolete. Use SQLITE_DEBUG instead."
#endif
-#if defined(SQLITE_DEBUG) && \
+#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
diff --git a/src/os_win.c b/src/os_win.c
index e685e20fa..acb06c69e 100644
--- a/src/os_win.c
+++ b/src/os_win.c
@@ -26,6 +26,14 @@
#include "os_win.h"
/*
+** Is the OSTRACE macro defined to actually do something?
+*/
+#if (defined(SQLITE_DEBUG) && SQLITE_OS_WIN) || \
+ (defined(SQLITE_TEST) || defined(SQLITE_FORCE_OS_TRACE))
+# define SQLITE_WIN32_HAS_OS_TRACE
+#endif
+
+/*
** Compiling and using WAL mode requires several APIs that are only
** available in Windows platforms based on the NT kernel.
*/
@@ -2746,7 +2754,7 @@ static int winSync(sqlite3_file *id, int flags){
BOOL rc;
#endif
#if !defined(NDEBUG) || !defined(SQLITE_NO_SYNC) || \
- (defined(SQLITE_TEST) && defined(SQLITE_DEBUG))
+ defined(SQLITE_WIN32_HAS_OS_TRACE)
/*
** Used when SQLITE_NO_SYNC is not defined and by the assert() and/or
** OSTRACE() macros.
@@ -3438,7 +3446,7 @@ struct winShm {
u8 hasMutex; /* True if holding the winShmNode mutex */
u16 sharedMask; /* Mask of shared locks held */
u16 exclMask; /* Mask of exclusive locks held */
-#ifdef SQLITE_DEBUG
+#if defined(SQLITE_DEBUG) || defined(SQLITE_WIN32_HAS_OS_TRACE)
u8 id; /* Id of this connection with its winShmNode */
#endif
};
diff --git a/src/printf.c b/src/printf.c
index 81efa057f..b559e9dfc 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -1045,7 +1045,8 @@ void sqlite3_log(int iErrCode, const char *zFormat, ...){
}
}
-#if defined(SQLITE_DEBUG)
+#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) || \
+ defined(SQLITE_FORCE_OS_TRACE)
/*
** A version of printf() that understands %lld. Used for debugging.
** The printf() built into some versions of windows does not understand %lld
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 92df2b703..45250bfd1 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -3491,7 +3491,7 @@ void *sqlite3HexToBlob(sqlite3*, const char *z, int n);
u8 sqlite3HexToInt(int h);
int sqlite3TwoPartName(Parse *, Token *, Token *, Token **);
-#if defined(SQLITE_DEBUG) && \
+#if (defined(SQLITE_DEBUG) && SQLITE_OS_WIN) || \
(defined(SQLITE_TEST) || defined(SQLITE_FORCE_OS_TRACE))
const char *sqlite3ErrName(int);
#endif