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++ CXX = g++
CFLAGS = -Wall -ansi -pedantic CFLAGS = -Wall -ansi -pedantic
#DFLAGS = -O3 -fomit-frame-pointer -DRELEASE_LEVEL=0 #DFLAGS = -O3 -fomit-frame-pointer -DDEBUG_LEVEL=0
DFLAGS = -g -DRELEASE_LEVEL=4 DFLAGS = -g -DDEBUG_LEVEL=4
#DFLAGS = -g -DRELEASE_LEVEL=2 -pg #DFLAGS = -g -DDEBUG_LEVEL=2 -pg
INCS = -I/sw/include \ INCS = -I/sw/include \
-I/usr/include/gcc/darwin/3.3/c++ \ -I/usr/include/gcc/darwin/3.3/c++ \
@ -84,7 +84,7 @@ include make.deps
install: install:
make clean make clean
make DFLAGS="-O3 -fomit-frame-pointer -DRELEASE_LEVEL=0" make DFLAGS="-O3 -fomit-frame-pointer -DDEBUG_LEVEL=0"
cp ledger $(HOME)/bin cp ledger $(HOME)/bin
strip $(HOME)/bin/ledger strip $(HOME)/bin/ledger

View file

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

24
debug.h
View file

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

View file

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