OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SKSL_UTIL | 8 #ifndef SKSL_UTIL |
9 #define SKSL_UTIL | 9 #define SKSL_UTIL |
10 | 10 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 int stoi(std::string s); | 93 int stoi(std::string s); |
94 | 94 |
95 double stod(std::string s); | 95 double stod(std::string s); |
96 | 96 |
97 long stol(std::string s); | 97 long stol(std::string s); |
98 | 98 |
99 NORETURN void sksl_abort(); | 99 NORETURN void sksl_abort(); |
100 | 100 |
101 } // namespace | 101 } // namespace |
102 | 102 |
103 #define ASSERT(x) SkASSERT(x) | 103 #ifdef DEBUG |
104 #define ASSERT_RESULT(x) SkAssertResult(x); | 104 #define ASSERT(x) assert(x) |
| 105 #define ASSERT_RESULT(x) ASSERT(x); |
| 106 #else |
| 107 #define ASSERT(x) |
| 108 #define ASSERT_RESULT(x) x |
| 109 #endif |
105 | 110 |
106 #ifdef SKIA | 111 #ifdef SKIA |
107 #define ABORT(...) { SkDebugf(__VA_ARGS__); sksl_abort(); } | 112 #define ABORT(...) { SkDebugf(__VA_ARGS__); sksl_abort(); } |
108 #else | 113 #else |
109 #define ABORT(...) { sksl_abort(); } | 114 #define ABORT(...) { sksl_abort(); } |
110 #endif | 115 #endif |
111 | 116 |
112 #endif | 117 #endif |
OLD | NEW |