From cd6262bbd746ac7a45e0904764da4e7b6aa00e76 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 14 Dec 2010 15:19:36 +0100 Subject: [PATCH] [binding php5] add inline implementation of lasso_log since it is a private function of lasso --- bindings/php5/wrapper_source_top.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/bindings/php5/wrapper_source_top.c b/bindings/php5/wrapper_source_top.c index 1b6bec7e..67a279a4 100644 --- a/bindings/php5/wrapper_source_top.c +++ b/bindings/php5/wrapper_source_top.c @@ -7,6 +7,28 @@ #include #include "php_lasso.h" #include "../ghashtable.h" +#define LASSO_LOG_STATIC + +#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 "../../lasso/utils.h" #include "../utils.c"