From 4b529d97ff8baa0aae1a9d1f5fb82d3aaa518297 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 13 Sep 2005 00:00:00 +0000 Subject: [PATCH] Automatically set the NDEBUG preprocessor macro unless SQLITE_DEBUG is set. In this way, assert() statements become opt-in rather than opt-out. (CVS 2690) FossilOrigin-Name: 2ec2bd85741e36e410f05ff34de430ffbcf51eea --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/sqliteInt.h | 13 ++++++++++++- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 523a97d5a5..78af7cca26 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Bug\sfix\sin\sthe\snew\sCOUNT(DISTINCT)\slogic.\s\sTicket\s#1420.\s(CVS\s2689) -D 2005-09-12T23:03:17 +C Automatically\sset\sthe\sNDEBUG\spreprocessor\smacro\sunless\sSQLITE_DEBUG\sis\sset.\nIn\sthis\sway,\sassert()\sstatements\sbecome\sopt-in\srather\sthan\sopt-out.\s(CVS\s2690) +D 2005-09-13T00:00:01 F Makefile.in 12784cdce5ffc8dfb707300c34e4f1eb3b8a14f1 F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -66,7 +66,7 @@ F src/random.c 90adff4e73a3b249eb4f1fc2a6ff9cf78c7233a4 F src/select.c 9ef1dddd436e1ea86a6bf64ae0ed71bf4a0b894f F src/shell.c 3596c1e559b82663057940d19ba533ad421c7dd3 F src/sqlite.h.in 461b2535550cf77aedfd44385da11ef7d63e57a2 -F src/sqliteInt.h 0d38d50ebe15a16a1253c9a6f9ce4ad188e097fe +F src/sqliteInt.h a01e12d5eb44bb516621edb81a42d0b81c3299d7 F src/table.c 25b3ff2b39b7d87e8d4a5da0713d68dfc06cbee9 F src/tclsqlite.c ac94682f9e601dd373912c46414a5a842db2089a F src/test1.c b569b60e35f0e3ea20e5ebfaf6e522a01c08d481 @@ -307,7 +307,7 @@ F www/tclsqlite.tcl 3df553505b6efcad08f91e9b975deb2e6c9bb955 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 2f397bd8142ec5e8f7238127012d14fdb558d918 -R 618d60bfccb929a4f836778c62dd17fb +P 37116550d33d8e3bdc15cd9998b9d2b97dec312b +R 4b6ab4c546ad13656b76ccf88bd8477b U drh -Z 26fb548fc8bf7d7e82c28eabe1666997 +Z 79948d57e91de7d6a58f8d5dadc245a4 diff --git a/manifest.uuid b/manifest.uuid index 0424adf2c0..86b8b574ee 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -37116550d33d8e3bdc15cd9998b9d2b97dec312b \ No newline at end of file +2ec2bd85741e36e410f05ff34de430ffbcf51eea \ No newline at end of file diff --git a/src/sqliteInt.h b/src/sqliteInt.h index e33d115f95..2c407864d0 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,11 +11,22 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.414 2005/09/10 15:28:09 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.415 2005/09/13 00:00:01 drh Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ +/* +** Many people are failing to set -DNDEBUG=1 when compiling SQLite. +** Setting NDEBUG makes the code smaller and run slower. So the following +** lines are added to automatically set NDEBUG unless the -DSQLITE_DEBUG=1 +** option is set. Thus NDEBUG becomes an opt-in rather than an opt-out +** feature. +*/ +#if !defined(NDEBUG) && defined(SQLITE_DEBUG) +# define NDEBUG 1 +#endif + /* ** These #defines should enable >2GB file support on Posix if the ** underlying operating system supports it. If the OS lacks -- 2.47.2