changed RELEASE_LEVEL to DEBUG_LEVEL

This commit is contained in:
John Wiegley 2004-08-21 05:45:33 -04:00
parent 86ac953379
commit 47cb7891c8
4 changed files with 21 additions and 21 deletions

View file

@ -22,9 +22,9 @@ OBJS = $(patsubst %.cc,%.o,$(CODE))
CXX = g++
CFLAGS = -Wall -ansi -pedantic
#DFLAGS = -O3 -fomit-frame-pointer -DRELEASE_LEVEL=0
DFLAGS = -g -DRELEASE_LEVEL=4
#DFLAGS = -g -DRELEASE_LEVEL=2 -pg
#DFLAGS = -O3 -fomit-frame-pointer -DDEBUG_LEVEL=0
DFLAGS = -g -DDEBUG_LEVEL=4
#DFLAGS = -g -DDEBUG_LEVEL=2 -pg
INCS = -I/sw/include \
-I/usr/include/gcc/darwin/3.3/c++ \
@ -84,7 +84,7 @@ include make.deps
install:
make clean
make DFLAGS="-O3 -fomit-frame-pointer -DRELEASE_LEVEL=0"
make DFLAGS="-O3 -fomit-frame-pointer -DDEBUG_LEVEL=0"
cp ledger $(HOME)/bin
strip $(HOME)/bin/ledger

View file

@ -26,7 +26,7 @@ static std::deque<commodity_t *> commodities;
static commodity_t::ident_t c_ident;
std::deque<amount_t::bigint_t *> bigints;
#if RELEASE_LEVEL >= ALPHA
#if DEBUG_LEVEL >= ALPHA
#define read_binary_guard(in, id) { \
unsigned short guard; \
in.read((char *)&guard, sizeof(guard)); \
@ -267,7 +267,7 @@ unsigned int binary_parser_t::parse(std::istream& in,
journal, master);
}
#if RELEASE_LEVEL >= ALPHA
#if DEBUG_LEVEL >= ALPHA
#define write_binary_guard(in, id) { \
unsigned short guard = id; \
out.write((char *)&guard, sizeof(guard)); \

24
debug.h
View file

@ -7,20 +7,20 @@
#define RELEASE 1
#define NO_SEATBELT 0
#ifndef RELEASE_LEVEL
#define RELEASE_LEVEL RELEASE
#ifndef DEBUG_LEVEL
#define DEBUG_LEVEL RELEASE
#endif
#if RELEASE_LEVEL >= ALPHA
#if DEBUG_LEVEL >= ALPHA
#include <cstdlib> // for `getenv'
#include <cstring> // for `strcmp'
#endif
#if RELEASE_LEVEL >= BETA
#if DEBUG_LEVEL >= BETA
#include <cassert>
#endif
#if RELEASE_LEVEL >= RELEASE
#if DEBUG_LEVEL >= RELEASE
#include <iostream>
#endif
@ -57,7 +57,7 @@ namespace ledger {
throw exc(s.str().c_str()); \
}
#if RELEASE_LEVEL >= ALPHA
#if DEBUG_LEVEL >= ALPHA
#include <pcre.h>
#include <cstring>
@ -91,13 +91,13 @@ bool _debug_active(const char * const cls);
#define CONFIRM(x) assert(x)
#if RELEASE_LEVEL == DEVELOPER
#if DEBUG_LEVEL == DEVELOPER
#define VALIDATE(x) assert(x)
#else
#define VALIDATE(x)
#endif
#else // RELEASE_LEVEL
#else // DEBUG_LEVEL
#define DEBUG_CLASS(cls)
#define DEBUG(cls) 0
@ -107,24 +107,24 @@ bool _debug_active(const char * const cls);
#define VALIDATE(x)
#if RELEASE_LEVEL == NO_SEATBELT
#if DEBUG_LEVEL == NO_SEATBELT
#undef assert
#define assert(x)
#define CONFIRM(x)
#elif RELEASE_LEVEL >= RELEASE
#elif DEBUG_LEVEL >= RELEASE
extern std::ostream * warning_stream;
#define CONFIRM(x)
#elif RELEASE_LEVEL >= BETA
#elif DEBUG_LEVEL >= BETA
#define CONFIRM(x) assert(x)
#endif
#endif // RELEASE_LEVEL
#endif // DEBUG_LEVEL
} // namespace ledger

View file

@ -16,10 +16,10 @@
#include <ctime>
#include <iostream>
#ifdef RELEASE_LEVEL
#if RELEASE_LEVEL >= 2
#ifdef DEBUG_LEVEL
#if DEBUG_LEVEL >= 2
#include "debug.h"
#elif RELEASE_LEVEL == 0
#elif DEBUG_LEVEL == 0
#define NO_CLEANUP 1
#endif
#endif