@@ -139,22 +139,25 @@ class DebuggingContext {
139
139
140
140
// assertions
141
141
#ifndef ASSERT
142
+ #define vmassert_with_file_and_line (p, file, line, ...)
142
143
#define vmassert (p, ...)
143
144
#else
144
145
// Note: message says "assert" rather than "vmassert" for backward
145
146
// compatibility with tools that parse/match the message text.
146
147
// Note: The signature is vmassert(p, format, ...), but the solaris
147
148
// compiler can't handle an empty ellipsis in a macro without a warning.
148
- #define vmassert (p, ...) \
149
- do { \
150
- if (! VMASSERT_CHECK_PASSED (p)) { \
151
- TOUCH_ASSERT_POISON; \
152
- report_vm_error (__FILE__, __LINE__ , " assert(" #p " ) failed" , __VA_ARGS__); \
153
- } \
149
+ #define vmassert_with_file_and_line (p, file, line, ...) \
150
+ do { \
151
+ if (! VMASSERT_CHECK_PASSED (p)) { \
152
+ TOUCH_ASSERT_POISON; \
153
+ report_vm_error (file, line , " assert(" #p " ) failed" , __VA_ARGS__); \
154
+ } \
154
155
} while (0 )
156
+ #define vmassert (p, ...) vmassert_with_file_and_line(p, __FILE__, __LINE__, __VA_ARGS__)
155
157
#endif
156
158
157
159
// For backward compatibility.
160
+ #define assert_with_file_and_line (p, file, line, ...) vmassert_with_file_and_line(p, file, line, __VA_ARGS__)
158
161
#define assert (p, ...) vmassert(p, __VA_ARGS__)
159
162
160
163
#define precond (p ) assert(p, " precond" )
0 commit comments