annotate src/audacious/debug.h @ 2873:7a0ca380c843 trunk

BSD relicensing (pass 13).
author William Pitcock <nenolod@atheme.org>
date Sat, 23 Jun 2007 23:20:05 -0500
parents 3149d4b1a9a9
children 4e39304e238b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2873
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
1 /*
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
2 * audacious: Cross-platform multimedia player.
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
3 * debug.h: Debugging macros.
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
4 *
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
5 * Copyright (c) 2005-2007 Audacious development team.
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
6 * Copyright (c) 2003-2005 BMP development team.
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
7 *
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
8 * Redistribution and use in source and binary forms, with or without
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
9 * modification, are permitted provided that the following conditions are
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
10 * met:
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
11 *
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
12 * 1. Redistributions of source code must retain the above copyright notice,
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
13 * this list of conditions and the following disclaimer.
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
14 *
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
15 * 2. Redistributions in binary form must reproduce the above copyright
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
16 * notice, this list of conditions and the following disclaimer in the
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
17 * documentation and/or other materials provided with the distribution.
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
18 *
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
19 * 3. The name of the author may not be used to endorse or promote products
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
20 * derived from this software without specific prior written permission.
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
21 *
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
24 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
25 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
30 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
31 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
32 * POSSIBILITY OF SUCH DAMAGE.
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
33 */
7a0ca380c843 BSD relicensing (pass 13).
William Pitcock <nenolod@atheme.org>
parents: 2313
diff changeset
34
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
35 #ifndef DEBUG_H
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
36 #define DEBUG_H
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
37
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
38 #include <glib.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
39
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
40 #ifdef NDEBUG
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
41
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
42 /* void REQUIRE_LOCK(GMutex *m); */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
43 # define REQUIRE_LOCK(m)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
44
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
45 /* void REQUIRE_STR_UTF8(const gchar *str); */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
46 # define REQUIRE_STR_UTF8(str)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
47
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
48 /* void REQUIRE_STATIC_LOCK(GStaticMutex *m); */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
49 # define REQUIRE_STATIC_LOCK(m)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
50
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
51 #else /* !NDEBUG */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
52
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
53 /* void REQUIRE_LOCK(GMutex *m); */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
54 # define REQUIRE_LOCK(m) G_STMT_START { \
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
55 if (g_mutex_trylock(m)) { \
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
56 g_critical(G_STRLOC ": Mutex not locked!"); \
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
57 g_mutex_unlock(m); \
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
58 } \
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
59 } G_STMT_END
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
60
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
61 /* void REQUIRE_STATIC_LOCK(GStaticMutex *m); */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
62 # define REQUIRE_STATIC_LOCK(m) G_STMT_START { \
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
63 if (G_TRYLOCK(m)) { \
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
64 g_critical(G_STRLOC ": Mutex not locked!"); \
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
65 G_UNLOCK(m); \
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
66 } \
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
67 } G_STMT_END
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
68
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
69 /* void REQUIRE_STR_UTF8(const gchar *str); */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
70 # define REQUIRE_STR_UTF8(str) G_STMT_START { \
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
71 if (!g_utf_validate(str, -1, NULL)) \
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
72 g_warning(G_STRLOC ": String is not UTF-8!"); \
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
73 } G_STMT_END
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
74
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
75 #endif /* NDEBUG */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
76
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
77
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
78 #endif