[M108 Migration][VD] Support set time and time zone offset
[platform/framework/web/chromium-efl.git] / base / notreached.h
1 // Copyright 2020 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_NOTREACHED_H_
6 #define BASE_NOTREACHED_H_
7
8 #include "base/base_export.h"
9 #include "base/check.h"
10 #include "base/dcheck_is_on.h"
11 #include "base/logging_buildflags.h"
12
13 namespace logging {
14
15 // Under these conditions NOTREACHED() will effectively either log or DCHECK.
16 #if BUILDFLAG(ENABLE_LOG_ERROR_NOT_REACHED) || DCHECK_IS_ON()
17 #define NOTREACHED() \
18   LAZY_CHECK_STREAM( \
19       ::logging::CheckError::NotReached(__FILE__, __LINE__).stream(), true)
20 #else
21 #define NOTREACHED() EAT_CHECK_STREAM_PARAMS()
22 #endif  // BUILDFLAG(ENABLE_LOG_ERROR_NOT_REACHED) || DCHECK_IS_ON()
23
24 // The NOTIMPLEMENTED() macro annotates codepaths which have not been
25 // implemented yet. If output spam is a serious concern,
26 // NOTIMPLEMENTED_LOG_ONCE can be used.
27 #if DCHECK_IS_ON()
28 #define NOTIMPLEMENTED()                                     \
29   ::logging::CheckError::NotImplemented(__FILE__, __LINE__,  \
30                                         __PRETTY_FUNCTION__) \
31       .stream()
32 #else
33 #define NOTIMPLEMENTED() EAT_CHECK_STREAM_PARAMS()
34 #endif
35
36 #define NOTIMPLEMENTED_LOG_ONCE()    \
37   {                                  \
38     static bool logged_once = false; \
39     if (!logged_once) {              \
40       NOTIMPLEMENTED();              \
41       logged_once = true;            \
42     }                                \
43   }                                  \
44   EAT_CHECK_STREAM_PARAMS()
45
46 }  // namespace logging
47
48 #endif  // BASE_NOTREACHED_H_