source: trunk/util/xc_trace.h

Last change on this file was 1537, checked in by moo, 3 months ago

fix debug build

  • Property svn:eol-style set to native
File size: 1.3 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 ZEND_WIN32
9#   ifndef inline
10#       ifdef ZEND_WIN32_FORCE_INLINE
11#           define inline __forceinline
12#       else
13#           define inline
14#       endif
15#   endif
16#endif
17
18#ifdef XCACHE_DEBUG
19#   define IFDEBUG(x) (x)
20#   include <stdarg.h>
21#   include <zend.h>
22int xc_vtrace(const char *fmt, va_list args);
23int xc_trace(const char *fmt, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
24
25#   ifdef ZEND_WIN32
26static inline int TRACE(const char *fmt, ...) 
27{
28    va_list args;
29    int ret;
30
31    va_start(args, fmt);
32    ret = xc_vtrace(fmt, args);
33    va_end(args);
34    return ret;
35}
36#   else
37const char *xc_trace_get_basename(const char *path);
38#       define TRACE(fmt, ...) \
39        xc_trace("%s:%04d: " fmt "\r\n", xc_trace_get_basename(__FILE__), __LINE__, __VA_ARGS__)
40#   endif /* ZEND_WIN32 */
41#   undef NDEBUG
42#   undef inline
43#   define inline
44#else /* XCACHE_DEBUG */
45
46#   ifdef ZEND_WIN32
47static inline int TRACE_DUMMY(const char *fmt, ...)
48{
49    return 0;
50}
51#       define TRACE 1 ? 0 : TRACE_DUMMY
52#   else
53#       define TRACE(fmt, ...) do { } while (0)
54#   endif /* ZEND_WIN32 */
55
56#   define IFDEBUG(x) do { } while (0)
57#endif /* XCACHE_DEBUG */
58#include <assert.h>
59
60#endif /* XC_TRACE_H_709AE2523EDACB72B54D9CB42DDB0FEE */
Note: See TracBrowser for help on using the repository browser.