2 * debug.h - debug-only interfaces
5 * Behdad Esfahbod, 2001, 2002, 2004
7 * Copyright (C) 2004 Sharif FarsiWeb, Inc.
8 * Copyright (C) 2001,2002 Behdad Esfahbod
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this library, in a file named COPYING; if not, write to the
22 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA
25 * For licensing issues, contact <fribidi.license@gmail.com>.
32 #include <fribidi-types.h>
34 #include <fribidi-begindecls.h>
38 /* These definitions should only be used in DEBUG mode: */
41 #endif /* !__LINE__ */
43 # define __FILE__ "unknown"
44 #endif /* !__FILE__ */
46 #ifndef FRIBIDI_FPRINTF
47 # ifndef __FRIBIDI_DOC
49 # endif /* !__FRIBIDI_DOC */
50 # define FRIBIDI_FPRINTF fprintf
51 # define FRIBIDI_STDERR_ stderr,
52 #endif /* !FRIBIDI_FPRINTF */
57 FRIBIDI_FPRINTF(FRIBIDI_STDERR_ s); \
61 FRIBIDI_FPRINTF(FRIBIDI_STDERR_ s, t); \
63 #define MSG3(s, t, u) \
65 FRIBIDI_FPRINTF(FRIBIDI_STDERR_ s, t, u); \
67 #define MSG5(s, t, u, v, w) \
69 FRIBIDI_FPRINTF(FRIBIDI_STDERR_ s, t, u, v, w); \
71 #define MSG6(s, t, u, v, w, z) \
73 FRIBIDI_FPRINTF(FRIBIDI_STDERR_ s, t, u, v, w, z); \
80 if (fribidi_debug_status()) { MSG(FRIBIDI ": " s "\n"); } \
84 if (fribidi_debug_status()) { MSG2(FRIBIDI ": " s "\n", t); } \
88 #ifndef fribidi_assert
89 # define fribidi_assert(cond) \
92 DBG(__FILE__ ":" STRINGIZE(__LINE__) ": " \
93 "assertion failed (" STRINGIZE(cond) ")"); \
96 #endif /* !fribidi_assert */
101 # define DBG(s) FRIBIDI_EMPTY_STMT
102 # define DBG2(s, t) FRIBIDI_EMPTY_STMT
104 #ifndef fribidi_assert
105 # define fribidi_assert(cond) FRIBIDI_EMPTY_STMT
106 #endif /* !fribidi_assert */
110 #include <fribidi-enddecls.h>
112 #endif /* !_DEBUG_H */
113 /* Editor directions:
114 * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent