2018-07-18 09:40:26 +00:00
|
|
|
// Copyright 2017 The Dawn Authors
|
2017-07-10 17:46:05 +00:00
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
#include "common/Assert.h"
|
2019-12-05 11:13:01 +00:00
|
|
|
#include "common/Log.h"
|
2017-07-10 17:46:05 +00:00
|
|
|
|
2019-12-19 16:07:58 +00:00
|
|
|
#include <cstdlib>
|
|
|
|
|
2017-11-24 16:45:29 +00:00
|
|
|
void HandleAssertionFailure(const char* file,
|
|
|
|
const char* function,
|
|
|
|
int line,
|
|
|
|
const char* condition) {
|
2019-12-06 18:21:39 +00:00
|
|
|
dawn::ErrorLog() << "Assertion failure at " << file << ":" << line << " (" << function
|
|
|
|
<< "): " << condition;
|
2019-12-19 16:07:58 +00:00
|
|
|
#if defined(DAWN_ABORT_ON_ASSERT)
|
|
|
|
abort();
|
|
|
|
#else
|
2018-07-18 11:37:54 +00:00
|
|
|
DAWN_BREAKPOINT();
|
2019-12-19 16:07:58 +00:00
|
|
|
#endif
|
2017-07-10 17:46:05 +00:00
|
|
|
}
|