view src/audacious/debug.h @ 3979:67f01143e613

improve on-demand probing: - playlist which contains subtunes is loaded properly. - custom uri is handled properly. - playlist_load_ins_file_tuple() has been rewritten. (necessary to subtune fix.) - playlist_load_ins_file() became wrapper function of playlist_load_ins_file_tuple(). - __playlist_ins_with_info() has been removed.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Wed, 21 Nov 2007 00:46:54 +0900
parents 3149d4b1a9a9
children 7a0ca380c843 2eee464379dc
line wrap: on
line source

#ifndef DEBUG_H
#define DEBUG_H

#include <glib.h>

#ifdef NDEBUG

/* void REQUIRE_LOCK(GMutex *m); */
#  define REQUIRE_LOCK(m)

/* void REQUIRE_STR_UTF8(const gchar *str); */
#  define REQUIRE_STR_UTF8(str)

/* void REQUIRE_STATIC_LOCK(GStaticMutex *m); */
#  define REQUIRE_STATIC_LOCK(m)

#else                           /* !NDEBUG */

/* void REQUIRE_LOCK(GMutex *m); */
#  define REQUIRE_LOCK(m) G_STMT_START { \
       if (g_mutex_trylock(m)) { \
           g_critical(G_STRLOC ": Mutex not locked!"); \
           g_mutex_unlock(m); \
       } \
   } G_STMT_END

/* void REQUIRE_STATIC_LOCK(GStaticMutex *m); */
#  define REQUIRE_STATIC_LOCK(m) G_STMT_START { \
       if (G_TRYLOCK(m)) { \
           g_critical(G_STRLOC ": Mutex not locked!"); \
           G_UNLOCK(m); \
       } \
   } G_STMT_END

/* void REQUIRE_STR_UTF8(const gchar *str); */
#  define REQUIRE_STR_UTF8(str) G_STMT_START { \
       if (!g_utf_validate(str, -1, NULL)) \
            g_warning(G_STRLOC ": String is not UTF-8!"); \
   } G_STMT_END

#endif                          /* NDEBUG */


#endif