From 0aead62974851c823d2c0209111a81b8565a561c Mon Sep 17 00:00:00 2001 From: Xuefer Date: Sun, 5 Jul 2009 05:36:11 +0000 Subject: [PATCH] merged r347,r348,r349,r350,r351,r352,r355 from trunk git-svn-id: svn://svn.lighttpd.net/xcache/branches/1.3@600 c26eb9a1-5813-0410-bd6c-c2e55f420ca7 --- .cvsignore | 1 + coverager/coverager.tpl.php | 2 +- utils.c | 8 ++++---- utils.h | 35 ++++++++++++++++++++++++++++++----- 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/.cvsignore b/.cvsignore index a5821e0..b9eee5f 100644 --- a/.cvsignore +++ b/.cvsignore @@ -31,3 +31,4 @@ processor.out processor_real.c run-tests.php structinfo.m4 +autom4te.cache diff --git a/coverager/coverager.tpl.php b/coverager/coverager.tpl.php index 31c0e81..b2d87db 100644 --- a/coverager/coverager.tpl.php +++ b/coverager/coverager.tpl.php @@ -198,7 +198,7 @@ else if ($action == 'file') { $dir_url = urlencode($dir); $dir_html = htmlspecialchars($dir); echo <<$l_root {$dir_html}/{$filename}
+ $l_root {$dir_html}/{$filename}
EOS; echo file_head(); diff --git a/utils.c b/utils.c index becb89f..57b1b84 100644 --- a/utils.c +++ b/utils.c @@ -731,17 +731,17 @@ void xc_sandbox_free(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_D /* }}} */ int xc_vtrace(const char *fmt, va_list args) /* {{{ */ { - vfprintf(stderr, fmt, args); - return 0; + return vfprintf(stderr, fmt, args); } /* }}} */ int xc_trace(const char *fmt, ...) /* {{{ */ { va_list args; + int ret; va_start(args, fmt); - xc_vtrace(fmt, args); + ret = xc_vtrace(fmt, args); va_end(args); - return 0; + return ret; } /* }}} */ diff --git a/utils.h b/utils.h index ec97123..1b9f6db 100644 --- a/utils.h +++ b/utils.h @@ -3,19 +3,44 @@ #ifdef DEBUG # define IFDEBUG(x) (x) -# define TRACE(fmt, ...) \ - xc_trace("%s:%d: " fmt "\r\n", __FILE__, __LINE__, __VA_ARGS__) +int xc_vtrace(const char *fmt, va_list args); int xc_trace(const char *fmt, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2); + +# ifdef ZEND_WIN32 +static inline int TRACE(const char *fmt, ...) +{ + va_list args; + int ret; + + va_start(args, fmt); + ret = xc_vtrace(fmt, args); + va_end(args); + return ret; +} +# else +# define TRACE(fmt, ...) \ + xc_trace("%s:%d: " fmt "\r\n", __FILE__, __LINE__, __VA_ARGS__) +# endif /* ZEND_WIN32 */ # undef NDEBUG # undef inline # define inline -#else -# define TRACE(fmt, ...) do { } while (0) +#else /* DEBUG */ + +# ifdef ZEND_WIN32 +static inline int TRACE_DUMMY(const char *fmt, ...) +{ + return 0; +} +# define TRACE 1 ? 0 : TRACE_DUMMY +# else +# define TRACE(fmt, ...) do { } while (0) +# endif /* ZEND_WIN32 */ + # define IFDEBUG(x) do { } while (0) # ifndef NDEBUG # define NDEBUG # endif -#endif +#endif /* DEBUG */ #include typedef struct {