2 * debug.h - debug-only interfaces
4 * $Id: debug.h,v 1.10 2006-01-31 03:23:12 behdad Exp $
6 * $Date: 2006-01-31 03:23:12 $
8 * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/debug.h,v $
11 * Behdad Esfahbod, 2001, 2002, 2004
13 * Copyright (C) 2004 Sharif FarsiWeb, Inc.
14 * Copyright (C) 2001,2002 Behdad Esfahbod
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License as published by the Free Software Foundation; either
19 * version 2.1 of the License, or (at your option) any later version.
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public License
27 * along with this library, in a file named COPYING; if not, write to the
28 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
29 * Boston, MA 02110-1301, USA
31 * For licensing issues, contact <license@farsiweb.info>.
38 #include <fribidi-types.h>
40 #include <fribidi-begindecls.h>
44 /* These definitions should only be used in DEBUG mode: */
47 #endif /* !__LINE__ */
49 # define __FILE__ "unknown"
50 #endif /* !__FILE__ */
52 #ifndef FRIBIDI_FPRINTF
53 # ifndef __FRIBIDI_DOC
55 # endif /* !__FRIBIDI_DOC */
56 # define FRIBIDI_FPRINTF fprintf
57 # define FRIBIDI_STDERR_ stderr,
58 #endif /* !FRIBIDI_FPRINTF */
63 FRIBIDI_FPRINTF(FRIBIDI_STDERR_ s); \
67 FRIBIDI_FPRINTF(FRIBIDI_STDERR_ s, t); \
69 #define MSG5(s, t, u, v, w) \
71 FRIBIDI_FPRINTF(FRIBIDI_STDERR_ s, t, u, v, w); \
78 if (fribidi_debug_status()) { MSG(FRIBIDI ": " s "\n"); } \
82 if (fribidi_debug_status()) { MSG2(FRIBIDI ": " s "\n", t); } \
86 #ifndef fribidi_assert
87 # define fribidi_assert(cond) \
90 DBG(__FILE__ ":" STRINGIZE(__LINE__) ": " \
91 "assertion failed (" STRINGIZE(cond) ")"); \
94 #endif /* !fribidi_assert */
99 # define DBG(s) FRIBIDI_EMPTY_STMT
100 # define DBG2(s, t) FRIBIDI_EMPTY_STMT
102 #ifndef fribidi_assert
103 # define fribidi_assert(cond) FRIBIDI_EMPTY_STMT
104 #endif /* !fribidi_assert */
108 #include <fribidi-enddecls.h>
110 #endif /* !_DEBUG_H */
111 /* Editor directions:
112 * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent