void *_local_unwind2_addr;
-/* Acceleration hack for ntoskrnl/dbg/print.c/DbgPrint() */
-gboolean captive_get_debug_messages(void)
-{
- g_return_val_if_fail(captive_options!=NULL,TRUE);
-
- return captive_options->debug_messages;
-}
-
+gboolean captive_debug_messages_disabled=FALSE;
static gboolean captive_w32_init(void)
{
{
g_return_if_fail(captive_options!=NULL);
+ /* FIXME: Fix sharing of different 'debug_messages' for various sandboxes. */
+ captive_debug_messages_disabled=!captive_options->debug_messages;
+
+ /* FIXME: Fix sharing of different 'debug_messages' for various sandboxes. */
if (!captive_options->debug_messages) {
/* FIXME: Save handler_id and destroy it in captive_vfs_close(). */
g_log_set_handler(
#endif
+/* g_log() and g_logv() acceleration */
+#ifdef LIBCAPTIVE
+#include <glib/gmessages.h> /* for g_log() */
+#include <glib/gtypes.h> /* for 'gboolean' */
+extern gboolean captive_debug_messages_disabled;
+#define g_log(log_domain,log_level,format,args...) ({ \
+ GLogLevelFlags _captive_g_log_log_level=(log_level); \
+ if ((_captive_g_log_log_level&~(G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_INFO|G_LOG_LEVEL_DEBUG)) \
+ || !captive_debug_messages_disabled) \
+ g_log((log_domain),_captive_g_log_log_level,(format) , ## args); \
+ })
+#define g_logv(log_domain,log_level,format,args) ({ \
+ GLogLevelFlags _captive_g_logv_log_level=(log_level); \
+ if ((_captive_g_logv_log_level&~(G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_INFO|G_LOG_LEVEL_DEBUG)) \
+ || !captive_debug_messages_disabled) \
+ g_logv((log_domain),_captive_g_logv_log_level,(format),(args)); \
+ })
+#endif /* LIBCAPTIVE */
+
+
#endif /* _CAPTIVE_CONFIG2_H */