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: Leave assert() alone now. Created Sept. 21, 2017, 12:48 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/StringMap.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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 #pragma once 18 #pragma once
19 19
20 #include "library.h" 20 #include "library.h"
21 21
22 #if defined(assert)
23 #undef assert
24 #endif
25
26 class String; 22 class String;
27 23
28 struct console_type 24 struct console_type
29 { 25 {
30 static void log(const String& str) 26 static void log(const String& str)
31 { 27 {
32 LogString(str); 28 LogString(str);
33 } 29 }
34 30
35 static void log(int i) 31 static void log(int i)
36 { 32 {
37 LogInteger(i); 33 LogInteger(i);
38 } 34 }
39 35
40 static void log(const void* ptr) 36 static void log(const void* ptr)
41 { 37 {
42 LogPointer(ptr); 38 LogPointer(ptr);
43 } 39 }
44 40
45 static void error(const String& str) 41 static void error(const String& str)
46 { 42 {
47 LogError(str); 43 LogError(str);
48 } 44 }
49 }; 45 };
50 46
51 static console_type console; 47 static console_type console;
52 48
53 #if defined(DEBUG) 49 #if defined(DEBUG)
54 inline void assert(bool condition, const String& str) 50 inline void assert2(bool condition, const String& str)
55 { 51 {
56 if (!condition) 52 if (!condition)
57 console.error(str); 53 console.error(str);
58 } 54 }
59 #else 55 #else
60 #define assert(condition, str) 56 #define assert2(condition, str)
61 #endif 57 #endif
62 58
63 #if defined(__EMSCRIPTEN_TRACING__) 59 #if defined(__EMSCRIPTEN_TRACING__)
64 #include <emscripten/trace.h> 60 #include <emscripten/trace.h>
65 61
66 inline void init_tracing() 62 inline void init_tracing()
67 { 63 {
68 emscripten_trace_configure("http://127.0.0.1:5000/", "MyApplication"); 64 emscripten_trace_configure("http://127.0.0.1:5000/", "MyApplication");
69 } 65 }
70 66
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 100
105 inline void enter_context(const char* context) 101 inline void enter_context(const char* context)
106 { 102 {
107 } 103 }
108 104
109 inline void exit_context() 105 inline void exit_context()
110 { 106 {
111 } 107 }
112 108
113 #endif // defined(__EMSCRIPTEN_TRACING__) 109 #endif // defined(__EMSCRIPTEN_TRACING__)
OLDNEW
« no previous file with comments | « compiled/StringMap.h ('k') | compiled/intrusive_ptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld