diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:03:48 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:03:48 -0800 |
commit | 4e468ed2eb86a2406e14f1eca82072ee501d05fd (patch) | |
tree | 4e05b3c66eef86531e464521a3bf96a1864d4bf5 /linker/linker_debug.h | |
parent | a27d2baa0c1a2ec70f47ea9199b1dd6762c8a349 (diff) | |
download | bionic-4e468ed2eb86a2406e14f1eca82072ee501d05fd.zip bionic-4e468ed2eb86a2406e14f1eca82072ee501d05fd.tar.gz bionic-4e468ed2eb86a2406e14f1eca82072ee501d05fd.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'linker/linker_debug.h')
-rw-r--r-- | linker/linker_debug.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/linker/linker_debug.h b/linker/linker_debug.h index 10ae7b1..fa2a1a1 100644 --- a/linker/linker_debug.h +++ b/linker/linker_debug.h @@ -27,15 +27,17 @@ #define TRUE 1 #define FALSE 0 + +#define __PRINTVF(v,f,x...) do { \ + (debug_verbosity > (v)) && (printf(x), ((f) && fflush(stdout))); \ + } while (0) /* Only use printf() during debugging. We have seen occasional memory * corruption when the linker uses printf(). */ #if LINKER_DEBUG extern int debug_verbosity; #warning "*** LINKER IS USING printf(); DO NOT CHECK THIS IN ***" -#define _PRINTVF(v,f,x...) do { \ - (debug_verbosity > (v)) && (printf(x), ((f) && fflush(stdout))); \ - } while (0) +#define _PRINTVF(v,f,x...) __PRINTVF(v,f,x) #else /* !LINKER_DEBUG */ #define _PRINTVF(v,f,x...) do {} while(0) #endif /* LINKER_DEBUG */ @@ -46,7 +48,7 @@ extern int debug_verbosity; #define WARN(fmt,args...) \ _PRINTVF(-1, TRUE, "%s:%d| WARNING: " fmt, __FILE__, __LINE__, ## args) #define ERROR(fmt,args...) \ - _PRINTVF(-1, TRUE, "%s:%d| ERROR: " fmt, __FILE__, __LINE__, ## args) + __PRINTVF(-1, TRUE, "%s:%d| ERROR: " fmt, __FILE__, __LINE__, ## args) #if TRACE_DEBUG #define DEBUG(x...) _PRINTVF(2, TRUE, "DEBUG: " x) |