mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-04 19:09:03 +02:00
[svn r135] * Merged DMD 1.025 *
* Fixed a minor linking order mishap * * Added an command line option -annotate * * Fixed some problems with running optimizations * * Added std.stdio and dependencies to lphobos (still not 100% working, but compiles and links) * * Fixed problems with passing aggregate types to variadic functions * * Added initial code towards full GC support, currently based on malloc and friends, not all the runtime calls the GC yet for memory * * Fixed problems with resolving nested function context pointers for some heavily nested cases * * Redid function argument passing + other minor code cleanups, still lots to do on this end... *
This commit is contained in:
@@ -13,30 +13,30 @@ namespace Logger
|
||||
static std::string indent_str;
|
||||
static std::ofstream null_out("/dev/null");
|
||||
|
||||
static bool enabled = false;
|
||||
static bool _enabled = false;
|
||||
void indent()
|
||||
{
|
||||
if (enabled) {
|
||||
if (_enabled) {
|
||||
indent_str += "* ";
|
||||
}
|
||||
}
|
||||
void undent()
|
||||
{
|
||||
if (enabled) {
|
||||
if (_enabled) {
|
||||
assert(!indent_str.empty());
|
||||
indent_str.resize(indent_str.size()-2);
|
||||
}
|
||||
}
|
||||
std::ostream& cout()
|
||||
{
|
||||
if (enabled)
|
||||
if (_enabled)
|
||||
return std::cout << indent_str;
|
||||
else
|
||||
return null_out;
|
||||
}
|
||||
void println(const char* fmt,...)
|
||||
{
|
||||
if (enabled) {
|
||||
if (_enabled) {
|
||||
printf(indent_str.c_str());
|
||||
va_list va;
|
||||
va_start(va,fmt);
|
||||
@@ -47,7 +47,7 @@ namespace Logger
|
||||
}
|
||||
void print(const char* fmt,...)
|
||||
{
|
||||
if (enabled) {
|
||||
if (_enabled) {
|
||||
printf(indent_str.c_str());
|
||||
va_list va;
|
||||
va_start(va,fmt);
|
||||
@@ -57,11 +57,15 @@ namespace Logger
|
||||
}
|
||||
void enable()
|
||||
{
|
||||
enabled = true;
|
||||
_enabled = true;
|
||||
}
|
||||
void disable()
|
||||
{
|
||||
enabled = false;
|
||||
_enabled = false;
|
||||
}
|
||||
bool enabled()
|
||||
{
|
||||
return _enabled;
|
||||
}
|
||||
void attention(const char* fmt,...)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user