File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Firestore/core/src/firebase/firestore/util Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 76
76
} \
77
77
} while (0 )
78
78
79
- // Assert with custom message that is not compiled out in release builds.
80
- #define FIREBASE_ASSERT_MESSAGE (expression, ...) \
81
- FIREBASE_ASSERT_MESSAGE_WITH_EXPRESSION (expression, expression, __VA_ARGS__)
82
-
83
79
// Assert condition is true otherwise display the specified expression,
84
80
// message and abort. Compiled out of release builds.
85
81
#if defined(NDEBUG)
106
102
// Indicates an area of the code that cannot be reached (except possibly due to
107
103
// undefined behaviour or other similar badness). The only reasonable thing to
108
104
// do in these cases is to immediately abort.
105
+ #if defined(__clang__) || defined(__GNUC__)
106
+ // Clang, GCC, (and Intel) compilers have a builtin
107
+ #define FIREBASE_UNREACHABLE () __builtin_unreachable()
108
+
109
+ #elif defined(_WIN32)
110
+ // Visual C++ doesn't have a builtin, but assuming an impossible condition has
111
+ // the same effect.
112
+ #define FIREBASE_UNREACHABLE () __assume(false )
113
+
114
+ #else
109
115
#define FIREBASE_UNREACHABLE () abort()
116
+ #endif // defined(__clang__) || defined(__GNUC__)
110
117
111
118
namespace firebase {
112
119
namespace firestore {
@@ -115,7 +122,7 @@ namespace util {
115
122
// A no-return helper function. To raise an assertion, use Macro instead.
116
123
ABSL_ATTRIBUTE_NORETURN void FailAssert (const char * file,
117
124
const char * func,
118
- const int line,
125
+ int line,
119
126
const char * format,
120
127
...);
121
128
You can’t perform that action at this time.
0 commit comments