Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: compiled/debug.h

Issue 29549903: Issue 5664 - assert now accept one parameter. (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Sept. 19, 2017, 6:45 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « compiled/String.h ('k') | compiled/intrusive_ptr.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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__)
OLDNEW
« no previous file with comments | « compiled/String.h ('k') | compiled/intrusive_ptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld