From 18aaf588ab55dfef5556e27ab69491f4c77ad303 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 30 Apr 2007 12:20:58 +0000 Subject: Added use of boost::optional<> to amount.h --- src/utils.h | 51 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 20 deletions(-) (limited to 'src/utils.h') diff --git a/src/utils.h b/src/utils.h index 8be512fb..da6aaa27 100644 --- a/src/utils.h +++ b/src/utils.h @@ -3,6 +3,26 @@ #include +/********************************************************************** + * + * Default values + */ + +#if defined(FULL_DEBUG) +#define VERIFY_ON 1 +#define TRACING_ON 1 +#define DEBUG_ON 1 +#define TIMERS_ON 1 +#define FREE_MEMORY 1 +#elif defined(NO_DEBUG) +#define NO_ASSERTS 1 +#define NO_LOGGING 1 +#else +#define VERIFY_ON 1 // compiled in, use --verify to enable +#define TRACING_ON 1 // use --trace X to enable +#define TIMERS_ON 1 +#endif + /********************************************************************** * * Forward declarations @@ -29,26 +49,6 @@ namespace ledger { typedef boost::filesystem::filesystem_error filesystem_error; } -/********************************************************************** - * - * Default values - */ - -#if defined(FULL_DEBUG) -#define VERIFY_ON 1 -#define TRACING_ON 1 -#define DEBUG_ON 1 -#define TIMERS_ON 1 -#define FREE_MEMORY 1 -#elif defined(NO_DEBUG) -#define NO_ASSERTS 1 -#define NO_LOGGING 1 -#else -#define VERIFY_ON 1 // compiled in, use --verify to enable -#define TRACING_ON 1 // use --trace X to enable -#define TIMERS_ON 1 // jww (2007-04-25): is this correct? -#endif - /********************************************************************** * * Assertions @@ -72,6 +72,10 @@ namespace ledger { ((x) ? ((void)0) : debug_assert(#x, BOOST_CURRENT_FUNCTION, \ __FILE__, __LINE__)) +#else // ! ASSERTS_ON + +#define assert(x) + #endif // ASSERTS_ON /********************************************************************** @@ -429,6 +433,13 @@ inline void throw_unexpected_error(char c, char wanted) { } // namespace ledger +/********************************************************************** + * + * Date/time support classes + */ + +#include "times.h" + /********************************************************************** * * General utility functions -- cgit v1.2.3