aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormistachkin <mistachkin@noemail.net>2015-04-28 23:34:10 +0000
committermistachkin <mistachkin@noemail.net>2015-04-28 23:34:10 +0000
commit5824d44babc81893534bcc1ded9d512da566f498 (patch)
treeb2b0927528acdff72cdb6b6f1db73958af7ac5bf /src
parentb10f22a14128e82ce8ec9b618567847330b9d8de (diff)
downloadsqlite-5824d44babc81893534bcc1ded9d512da566f498.tar.gz
sqlite-5824d44babc81893534bcc1ded9d512da566f498.zip
Revise when the sqlite3ErrName() function is defined.
FossilOrigin-Name: 9e593fb3dbc58e86f499ba4399530e3e760eb84d
Diffstat (limited to 'src')
-rw-r--r--src/main.c2
-rw-r--r--src/sqliteInt.h15
2 files changed, 15 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 27a0fe58d..ff5a1061b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1206,7 +1206,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) || defined(SQLITE_HAVE_OS_TRACE)
+#if defined(SQLITE_NEED_ERR_NAME)
const char *sqlite3ErrName(int rc){
const char *zName = 0;
int i, origRc = rc;
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 56fd2e14f..5a393b27d 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -376,6 +376,19 @@
#endif
/*
+** Is the sqlite3ErrName() function needed in the build? Currently,
+** it is needed by "mutex_w32.c" (when debugging), "os_win.c" (when
+** OSTRACE is enabled), and by several "test*.c" files (which are
+** compiled using SQLITE_TEST).
+*/
+#if defined(SQLITE_HAVE_OS_TRACE) || defined(SQLITE_TEST) || \
+ (defined(SQLITE_DEBUG) && SQLITE_OS_WIN)
+# define SQLITE_NEED_ERR_NAME
+#else
+# undef SQLITE_NEED_ERR_NAME
+#endif
+
+/*
** Return true (non-zero) if the input is an integer that is too large
** to fit in 32-bits. This macro is used inside of various testcase()
** macros to verify that we have tested SQLite for large-file support.
@@ -3506,7 +3519,7 @@ void *sqlite3HexToBlob(sqlite3*, const char *z, int n);
u8 sqlite3HexToInt(int h);
int sqlite3TwoPartName(Parse *, Token *, Token *, Token **);
-#if defined(SQLITE_DEBUG) || defined(SQLITE_HAVE_OS_TRACE)
+#if defined(SQLITE_NEED_ERR_NAME)
const char *sqlite3ErrName(int);
#endif