Daniel Stenberg | f9b4490 | 2003-02-07 09:41:57 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2002 by Linus Nielsen Feltzing |
| 11 | * |
| 12 | * All files in this archive are subject to the GNU General Public License. |
| 13 | * See the file COPYING in the source tree root for full license agreement. |
| 14 | * |
| 15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 16 | * KIND, either express or implied. |
| 17 | * |
| 18 | ****************************************************************************/ |
| 19 | #ifndef DEBUG_H |
| 20 | #define DEBUG_H |
| 21 | |
| 22 | extern void debug_init(void); |
Jens Arnold | 2f20b3e | 2004-08-18 19:59:06 +0000 | [diff] [blame] | 23 | extern void debugf(const char* fmt,...); |
| 24 | extern void ldebugf(const char* file, int line, const char *fmt, ...); |
Daniel Stenberg | f9b4490 | 2003-02-07 09:41:57 +0000 | [diff] [blame] | 25 | |
| 26 | #ifdef __GNUC__ |
| 27 | |
| 28 | /* */ |
| 29 | #if defined(SIMULATOR) |
| 30 | #define DEBUGF debugf |
| 31 | #define LDEBUGF(...) ldebugf(__FILE__, __LINE__, __VA_ARGS__) |
| 32 | #else |
| 33 | #if defined(DEBUG) |
Tomasz Malesinski | ec7e976 | 2006-02-04 00:04:02 +0000 | [diff] [blame^] | 34 | |
| 35 | #ifdef HAVE_GDB_API |
| 36 | void breakpoint(void); |
| 37 | #endif |
| 38 | |
Daniel Stenberg | f9b4490 | 2003-02-07 09:41:57 +0000 | [diff] [blame] | 39 | #define DEBUGF debugf |
| 40 | #define LDEBUGF debugf |
| 41 | #else |
| 42 | #define DEBUGF(...) |
| 43 | #define LDEBUGF(...) |
| 44 | #endif |
| 45 | #endif |
| 46 | |
| 47 | |
| 48 | #else |
| 49 | |
| 50 | #define DEBUGF debugf |
| 51 | #define LDEBUGF debugf |
| 52 | |
| 53 | #endif /* GCC */ |
| 54 | |
| 55 | |
| 56 | #endif |