diff options
| author | 2010-01-22 13:45:53 +0100 | |
|---|---|---|
| committer | 2010-01-22 13:45:53 +0100 | |
| commit | ab56c34e17f2f44fd51ff3e890c002215fbe7690 (patch) | |
| tree | 75a8ba61bec72e351d466739ef5dfa751a1b46fd /src/debug.h | |
| parent | 808d461fea2c1b028e8fbb232eb09a94555856e8 (diff) | |
| download | libimobiledevice-ab56c34e17f2f44fd51ff3e890c002215fbe7690.tar.gz libimobiledevice-ab56c34e17f2f44fd51ff3e890c002215fbe7690.tar.bz2 | |
Turn debug_plist into macro to show caller func/file/line and improve output
Diffstat (limited to 'src/debug.h')
| -rw-r--r-- | src/debug.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/debug.h b/src/debug.h index 0a29be3..2fd0960 100644 --- a/src/debug.h +++ b/src/debug.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | * contains utilitary functions for debugging | 3 | * contains utilitary functions for debugging |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2008 Jonathan Beck All Rights Reserved. | 5 | * Copyright (c) 2008 Jonathan Beck All Rights Reserved. |
| 6 | * Copyright (c) 2010 Martin S. All Rights Reserved. | ||
| 6 | * | 7 | * |
| 7 | * This library is free software; you can redistribute it and/or | 8 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Lesser General Public | 9 | * modify it under the terms of the GNU Lesser General Public |
| @@ -27,10 +28,13 @@ | |||
| 27 | 28 | ||
| 28 | #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && !defined(STRIP_DEBUG_CODE) | 29 | #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && !defined(STRIP_DEBUG_CODE) |
| 29 | #define debug_info(...) debug_info_real (__func__, __FILE__, __LINE__, __VA_ARGS__) | 30 | #define debug_info(...) debug_info_real (__func__, __FILE__, __LINE__, __VA_ARGS__) |
| 31 | #define debug_plist(a) debug_plist_real (__func__, __FILE__, __LINE__, a) | ||
| 30 | #elif defined(__GNUC__) && __GNUC__ >= 3 && !defined(STRIP_DEBUG_CODE) | 32 | #elif defined(__GNUC__) && __GNUC__ >= 3 && !defined(STRIP_DEBUG_CODE) |
| 31 | #define debug_info(...) debug_info_real (__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) | 33 | #define debug_info(...) debug_info_real (__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) |
| 34 | #define debug_plist(a) debug_plist_real (__FUNCTION__, __FILE__, __LINE__, a) | ||
| 32 | #else | 35 | #else |
| 33 | #define debug_info(...) | 36 | #define debug_info(...) |
| 37 | #define debug_plist(a) | ||
| 34 | #endif | 38 | #endif |
| 35 | 39 | ||
| 36 | G_GNUC_INTERNAL inline void debug_info_real(const char *func, | 40 | G_GNUC_INTERNAL inline void debug_info_real(const char *func, |
| @@ -40,6 +44,9 @@ G_GNUC_INTERNAL inline void debug_info_real(const char *func, | |||
| 40 | 44 | ||
| 41 | G_GNUC_INTERNAL inline void debug_buffer(const char *data, const int length); | 45 | G_GNUC_INTERNAL inline void debug_buffer(const char *data, const int length); |
| 42 | G_GNUC_INTERNAL inline void debug_buffer_to_file(const char *file, const char *data, const int length); | 46 | G_GNUC_INTERNAL inline void debug_buffer_to_file(const char *file, const char *data, const int length); |
| 43 | G_GNUC_INTERNAL inline void debug_plist(plist_t plist); | 47 | G_GNUC_INTERNAL inline void debug_plist_real(const char *func, |
| 48 | const char *file, | ||
| 49 | int line, | ||
| 50 | plist_t plist); | ||
| 44 | 51 | ||
| 45 | #endif | 52 | #endif |
