source: trunk/util/xc_trace.h @ 984

Last change on this file since 984 was 984, checked in by moo, 21 months ago

missed from previous commit

  • Property svn:eol-style set to native
File size: 1.0 KB
Line 
1#ifndef XC_TRACE_H_709AE2523EDACB72B54D9CB42DDB0FEE
2#define XC_TRACE_H_709AE2523EDACB72B54D9CB42DDB0FEE
3
4#if _MSC_VER > 1000
5#pragma once
6#endif // _MSC_VER > 1000
7
8#ifdef XCACHE_DEBUG
9#   define IFDEBUG(x) (x)
10int xc_vtrace(const char *fmt, va_list args);
11int xc_trace(const char *fmt, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
12
13#   ifdef ZEND_WIN32
14static inline int TRACE(const char *fmt, ...) 
15{
16    va_list args;
17    int ret;
18
19    va_start(args, fmt);
20    ret = xc_vtrace(fmt, args);
21    va_end(args);
22    return ret;
23}
24#   else
25#       define TRACE(fmt, ...) \
26        xc_trace("%s:%d: " fmt "\r\n", __FILE__, __LINE__, __VA_ARGS__)
27#   endif /* ZEND_WIN32 */
28#   undef NDEBUG
29#   undef inline
30#   define inline
31#else /* XCACHE_DEBUG */
32
33#   ifdef ZEND_WIN32
34static inline int TRACE_DUMMY(const char *fmt, ...)
35{
36    return 0;
37}
38#       define TRACE 1 ? 0 : TRACE_DUMMY
39#   else
40#       define TRACE(fmt, ...) do { } while (0)
41#   endif /* ZEND_WIN32 */
42
43#   define IFDEBUG(x) do { } while (0)
44#endif /* XCACHE_DEBUG */
45#include <assert.h>
46
47#endif /* XC_TRACE_H_709AE2523EDACB72B54D9CB42DDB0FEE */
Note: See TracBrowser for help on using the repository browser.