[runtime] Old impl of RuntimeAssert for backward compatibility

This commit is contained in:
Igor Chevdar
2020-12-21 18:52:14 +05:00
committed by Nikolay Krasko
parent d401d29418
commit a6c119c3cd
@@ -30,3 +30,16 @@ RUNTIME_NORETURN void RuntimeAssertFailed(const char* location, const char* form
// TODO: Write the stacktrace.
konan::abort();
}
// TODO: this function is not used by runtime, but apparently there are
// third-party libraries that use it (despite the fact it is not a public API).
// Keeping the function here for now for backward compatibility, to be removed later.
RUNTIME_NORETURN void RuntimeAssertFailed(const char* location, const char* message) {
char buf[1024];
if (location != nullptr)
konan::snprintf(buf, sizeof(buf), "%s: runtime assert: %s\n", location, message);
else
konan::snprintf(buf, sizeof(buf), "runtime assert: %s\n", message);
konan::consoleErrorUtf8(buf, konan::strnlen(buf, sizeof(buf)));
konan::abort();
}