1 // Copyright 2020 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef BASE_NOTREACHED_H_
6 #define BASE_NOTREACHED_H_
8 #include "base/check.h"
9 #include "base/logging_buildflags.h"
13 #if BUILDFLAG(ENABLE_LOG_ERROR_NOT_REACHED)
14 void BASE_EXPORT LogErrorNotReached(const char* file, int line);
15 #define NOTREACHED() \
16 true ? ::logging::LogErrorNotReached(__FILE__, __LINE__) \
17 : EAT_CHECK_STREAM_PARAMS()
19 #define NOTREACHED() DCHECK(false)
22 // The NOTIMPLEMENTED() macro annotates codepaths which have not been
23 // implemented yet. If output spam is a serious concern,
24 // NOTIMPLEMENTED_LOG_ONCE can be used.
26 #define NOTIMPLEMENTED() \
27 ::logging::CheckError::NotImplemented(__FILE__, __LINE__, \
28 __PRETTY_FUNCTION__) \
31 #define NOTIMPLEMENTED() EAT_CHECK_STREAM_PARAMS()
34 #define NOTIMPLEMENTED_LOG_ONCE() \
36 static bool logged_once = false; \
42 EAT_CHECK_STREAM_PARAMS()
44 } // namespace logging
46 #endif // BASE_NOTREACHED_H_