nonlib: Use GNU extension program_invocation_short_name to get module name for debug output.
This commit is contained in:
parent
c794617b30
commit
0c4161ce85
|
@ -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…
Reference in New Issue