diff options
Diffstat (limited to 'libexec/rtld-elf/debug.h')
-rw-r--r-- | libexec/rtld-elf/debug.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libexec/rtld-elf/debug.h b/libexec/rtld-elf/debug.h index b356338..2600651 100644 --- a/libexec/rtld-elf/debug.h +++ b/libexec/rtld-elf/debug.h @@ -38,6 +38,9 @@ #include <sys/cdefs.h> +#include <string.h> +#include <unistd.h> + extern void debug_printf(const char *, ...) __printflike(1, 2); extern int debug; @@ -47,4 +50,10 @@ extern int debug; #define dbg(format, args...) ((void) 0) #endif +#define assert(cond) ((cond) ? (void) 0 : \ + (msg("ld-elf.so.1: assert failed: " __FILE__ ":" \ + __XSTRING(__LINE__) "\n"), abort())) +#define msg(s) write(1, s, strlen(s)) +#define trace() msg("ld-elf.so.1: " __XSTRING(__LINE__) "\n") + #endif /* DEBUG_H */ |