Browse Source

nonlib: Use GNU extension program_invocation_short_name to get module name for debug output.

tags/non-daw-v1.2.0
Jonathan Moore Liles 12 years ago
parent
commit
0c4161ce85
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      nonlib/debug.C

+ 5
- 1
nonlib/debug.C View File

@@ -23,6 +23,8 @@
#include <stdio.h>
#include <stdarg.h>

extern char * program_invocation_short_name;

void
warnf ( warning_t level,
const char *module,
@@ -36,8 +38,10 @@ warnf ( warning_t level,
"assertion", "\033[1;31m"
};

module = program_invocation_short_name;

if ( module )
fprintf( stderr, "[%s] ", module );
fprintf( stderr, "[\033[1;30m%s\033[0m] ", module );
#ifndef NDEBUG
if ( file )
fprintf( stderr, "%s", file );


Loading…
Cancel
Save