155 void report_vm_error(const char* file, int line, const char* error_msg); |
152 void report_vm_error(const char* file, int line, const char* error_msg); |
156 #if !defined(__GNUC__) || defined (__clang_major__) || (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || __GNUC__ > 4) |
153 #if !defined(__GNUC__) || defined (__clang_major__) || (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || __GNUC__ > 4) |
157 // ATTRIBUTE_PRINTF works with gcc >= 4.8 and any other compiler. |
154 // ATTRIBUTE_PRINTF works with gcc >= 4.8 and any other compiler. |
158 void report_vm_error(const char* file, int line, const char* error_msg, |
155 void report_vm_error(const char* file, int line, const char* error_msg, |
159 const char* detail_fmt, ...) ATTRIBUTE_PRINTF(4, 5); |
156 const char* detail_fmt, ...) ATTRIBUTE_PRINTF(4, 5); |
160 #ifdef ASSERT |
|
161 void report_assert_msg(const char* msg, ...) ATTRIBUTE_PRINTF(1, 2); |
|
162 #endif // ASSERT |
|
163 #else |
157 #else |
164 // GCC < 4.8 warns because of empty format string. Warning can not be switched off selectively. |
158 // GCC < 4.8 warns because of empty format string. Warning can not be switched off selectively. |
165 void report_vm_error(const char* file, int line, const char* error_msg, |
159 void report_vm_error(const char* file, int line, const char* error_msg, |
166 const char* detail_fmt, ...); |
160 const char* detail_fmt, ...); |
167 #ifdef ASSERT |
|
168 void report_assert_msg(const char* msg, ...); |
|
169 #endif // ASSERT |
|
170 #endif |
161 #endif |
171 void report_vm_status_error(const char* file, int line, const char* error_msg, |
162 void report_vm_status_error(const char* file, int line, const char* error_msg, |
172 int status, const char* detail); |
163 int status, const char* detail); |
173 void report_fatal(const char* file, int line, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(3, 4); |
164 void report_fatal(const char* file, int line, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(3, 4); |
174 void report_vm_out_of_memory(const char* file, int line, size_t size, VMErrorType vm_err_type, |
165 void report_vm_out_of_memory(const char* file, int line, size_t size, VMErrorType vm_err_type, |
175 const char* detail_fmt, ...) ATTRIBUTE_PRINTF(5, 6); |
166 const char* detail_fmt, ...) ATTRIBUTE_PRINTF(5, 6); |
176 void report_should_not_call(const char* file, int line); |
167 void report_should_not_call(const char* file, int line); |
177 void report_should_not_reach_here(const char* file, int line); |
168 void report_should_not_reach_here(const char* file, int line); |
178 void report_unimplemented(const char* file, int line); |
169 void report_unimplemented(const char* file, int line); |
179 void report_untested(const char* file, int line, const char* message); |
170 void report_untested(const char* file, int line, const char* message); |
180 |
|
181 #ifdef ASSERT |
|
182 // unit test support |
|
183 bool is_executing_unit_tests(); |
|
184 #endif // ASSERT |
|
185 |
171 |
186 void warning(const char* format, ...) ATTRIBUTE_PRINTF(1, 2); |
172 void warning(const char* format, ...) ATTRIBUTE_PRINTF(1, 2); |
187 |
173 |
188 // Compile-time asserts. Cond must be a compile-time constant expression that |
174 // Compile-time asserts. Cond must be a compile-time constant expression that |
189 // is convertible to bool. STATIC_ASSERT() can be used anywhere a declaration |
175 // is convertible to bool. STATIC_ASSERT() can be used anywhere a declaration |