OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 static void error(const String& str) | 45 static void error(const String& str) |
46 { | 46 { |
47 LogError(str); | 47 LogError(str); |
48 } | 48 } |
49 }; | 49 }; |
50 | 50 |
51 static console_type console; | 51 static console_type console; |
52 | 52 |
53 #if defined(DEBUG) | 53 #if defined(DEBUG) |
54 inline void assert(bool condition, const String& str) | 54 #define assert(condition) \ |
| 55 assert2(condition, u"Assertion failed: "##condition""_str) |
| 56 |
| 57 inline void assert2(bool condition, const String& str) |
55 { | 58 { |
56 if (!condition) | 59 if (!condition) |
57 console.error(str); | 60 console.error(str); |
58 } | 61 } |
59 #else | 62 #else |
60 #define assert(condition, str) | 63 #define assert(condition) |
| 64 #define assert2(condition, str) |
61 #endif | 65 #endif |
62 | 66 |
63 #if defined(__EMSCRIPTEN_TRACING__) | 67 #if defined(__EMSCRIPTEN_TRACING__) |
64 #include <emscripten/trace.h> | 68 #include <emscripten/trace.h> |
65 | 69 |
66 inline void init_tracing() | 70 inline void init_tracing() |
67 { | 71 { |
68 emscripten_trace_configure("http://127.0.0.1:5000/", "MyApplication"); | 72 emscripten_trace_configure("http://127.0.0.1:5000/", "MyApplication"); |
69 } | 73 } |
70 | 74 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 108 |
105 inline void enter_context(const char* context) | 109 inline void enter_context(const char* context) |
106 { | 110 { |
107 } | 111 } |
108 | 112 |
109 inline void exit_context() | 113 inline void exit_context() |
110 { | 114 { |
111 } | 115 } |
112 | 116 |
113 #endif // defined(__EMSCRIPTEN_TRACING__) | 117 #endif // defined(__EMSCRIPTEN_TRACING__) |
OLD | NEW |