From a9b673cd4a9a5ee64d8d04f5e3c03978a799f837 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Sat, 12 Jun 2010 00:43:49 +0000 Subject: Core: move logging function and macros to their own module, adapt perl binding --- bindings/perl/lang.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'bindings') diff --git a/bindings/perl/lang.py b/bindings/perl/lang.py index 64e9d189..f01c88ba 100644 --- a/bindings/perl/lang.py +++ b/bindings/perl/lang.py @@ -141,10 +141,31 @@ GHashTable*\tT_PTRREF #include "XSUB.h" #include +#if defined(__GNUC__) +# define lasso_log(level, filename, line, function, format, args...) \ + g_log("Lasso", level, "%s:%i:%s" format, filename, line, function, ##args) +#elif defined(HAVE_VARIADIC_MACROS) +# define lasso_log(level, format, line, function, ...) \ + g_log("Lasso", leve, "%s:%i:%s" format, filename, line, function, __VA_ARGS__) +#else +static inline void lasso_log(GLogLevelFlags level, const char *filename, + int line, const char *function, const char *format, ...) +{ + va_list ap; + char s[1024]; + va_start(ap, format); + g_vsnprintf(s, 1024, format, ap); + va_end(ap); + g_log("Lasso", level, "%s:%i:%s %s", filename, line, function, s); +} +#define lasso_log lasso_log +#endif + #include "./gobject_handling.c" #include "./glist_handling.c" #include "./ghashtable_handling.c" + #define lasso_assign_simple(a,b) a = b; typedef char* string_non_null; -- cgit