11cb0ef41Sopenharmony_ci// Copyright 2020 the V8 project authors. All rights reserved.
21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be
31cb0ef41Sopenharmony_ci// found in the LICENSE file.
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci#include "include/cppgc/internal/logging.h"
61cb0ef41Sopenharmony_ci#include "include/cppgc/source-location.h"
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ci#include "src/base/logging.h"
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_cinamespace cppgc {
111cb0ef41Sopenharmony_cinamespace internal {
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_civoid DCheckImpl(const char* message, const SourceLocation& loc) {
141cb0ef41Sopenharmony_ci  V8_Dcheck(loc.FileName(), static_cast<int>(loc.Line()), message);
151cb0ef41Sopenharmony_ci}
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_civoid FatalImpl(const char* message, const SourceLocation& loc) {
181cb0ef41Sopenharmony_ci#if DEBUG
191cb0ef41Sopenharmony_ci  V8_Fatal(loc.FileName(), static_cast<int>(loc.Line()), "Check failed: %s.",
201cb0ef41Sopenharmony_ci           message);
211cb0ef41Sopenharmony_ci#elif !defined(OFFICIAL_BUILD)
221cb0ef41Sopenharmony_ci  V8_Fatal("Check failed: %s.", message);
231cb0ef41Sopenharmony_ci#else
241cb0ef41Sopenharmony_ci  V8_Fatal("ignored");
251cb0ef41Sopenharmony_ci#endif
261cb0ef41Sopenharmony_ci}
271cb0ef41Sopenharmony_ci
281cb0ef41Sopenharmony_ci}  // namespace internal
291cb0ef41Sopenharmony_ci}  // namespace cppgc
30