Inline an inline function into the CHECK macro

CheckHelper was only used within the macro itself. Furthermore, GCC
with -Winline was not always happy with the inline function. Simple
solution: Inline the inline function into the macro itself. Inlining
squared!

Review URL: https://chromiumcodereview.appspot.com/9295048

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10550 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f8115b34
......@@ -51,20 +51,12 @@ extern "C" void V8_Fatal(const char* file, int line, const char* format, ...);
#endif
// Used by the CHECK macro -- should not be called directly.
inline void CheckHelper(const char* file,
int line,
const char* source,
bool condition) {
if (!condition)
V8_Fatal(file, line, "CHECK(%s) failed", source);
}
// The CHECK macro checks that the given condition is true; if not, it
// prints a message to stderr and aborts.
#define CHECK(condition) do { \
if (!(condition)) CheckHelper(__FILE__, __LINE__, #condition, false); \
#define CHECK(condition) do { \
if (!(condition)) { \
V8_Fatal(__FILE__, __LINE__, "CHECK(%s) failed", #condition); \
} \
} while (0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment