diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-12-14 15:19:36 +0100 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-12-14 15:19:36 +0100 |
| commit | e0bda6914ca153f2d2952b807fd7f40f6b3f5345 (patch) | |
| tree | c5afdcf44e080e58d15a03ce04f8ee36b1b58a2e | |
| parent | 67083e3050d4e84242ffda3bc94bffa006b1e0b9 (diff) | |
| download | lasso-e0bda6914ca153f2d2952b807fd7f40f6b3f5345.tar.gz lasso-e0bda6914ca153f2d2952b807fd7f40f6b3f5345.tar.xz lasso-e0bda6914ca153f2d2952b807fd7f40f6b3f5345.zip | |
[binding php5] add inline implementation of lasso_log since it is a private function of lasso
| -rw-r--r-- | bindings/php5/wrapper_source_top.c | 22 |
1 files changed, 22 insertions, 0 deletions
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 <lasso/lasso.h> #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" |
