Initial commit
[yaffs-website] / node_modules / node-sass / src / libsass / src / debug.hpp
1 #ifndef SASS_DEBUG_H
2 #define SASS_DEBUG_H
3
4 #include <stdint.h>
5
6 #ifndef UINT32_MAX
7   #define UINT32_MAX 0xffffffffU
8 #endif
9
10 enum dbg_lvl_t : uint32_t {
11   NONE = 0,
12   TRIM = 1,
13   CHUNKS = 2,
14   SUBWEAVE = 4,
15   WEAVE = 8,
16   EXTEND_COMPOUND = 16,
17   EXTEND_COMPLEX = 32,
18   LCS = 64,
19   EXTEND_OBJECT = 128,
20   ALL = UINT32_MAX
21 };
22
23 #ifdef DEBUG
24
25 #ifndef DEBUG_LVL
26 const uint32_t debug_lvl = UINT32_MAX;
27 #else
28 const uint32_t debug_lvl = (DEBUG_LVL);
29 #endif // DEBUG_LVL
30
31 #define DEBUG_PRINT(lvl, x) if((lvl) & debug_lvl) { std::cerr << x; }
32 #define DEBUG_PRINTLN(lvl, x) if((lvl) & debug_lvl) { std::cerr << x << std::endl; }
33 #define DEBUG_EXEC(lvl, x) if((lvl) & debug_lvl) { x; }
34
35 #else // DEBUG
36
37 #define DEBUG_PRINT(lvl, x)
38 #define DEBUG_PRINTLN(lvl, x)
39 #define DEBUG_EXEC(lvl, x)
40
41 #endif // DEBUG
42
43 #endif // SASS_DEBUG