Index: webrtc/rtc_base/checks.h |
diff --git a/webrtc/rtc_base/checks.h b/webrtc/rtc_base/checks.h |
index f9507e239cad0cab48bd20a159d30cf7abdd86e0..d1a3ccb91b4488f0d3c2309cbd25bfadaac9298e 100644 |
--- a/webrtc/rtc_base/checks.h |
+++ b/webrtc/rtc_base/checks.h |
@@ -11,8 +11,6 @@ |
#ifndef WEBRTC_RTC_BASE_CHECKS_H_ |
#define WEBRTC_RTC_BASE_CHECKS_H_ |
-#include "webrtc/typedefs.h" |
- |
// If you for some reson need to know if DCHECKs are on, test the value of |
// RTC_DCHECK_IS_ON. (Test its value, not if it's defined; it'll always be |
// defined, to either a true or a false value.) |
@@ -22,10 +20,20 @@ |
#define RTC_DCHECK_IS_ON 0 |
#endif |
+// Annotate a function that will not return control flow to the caller. |
+#if defined(_MSC_VER) |
+#define RTC_NO_RETURN __declspec(noreturn) |
+#elif defined(__GNUC__) |
+#define RTC_NO_RETURN __attribute__ ((__noreturn__)) |
+#else |
+#define RTC_NO_RETURN |
+#endif |
+ |
#ifdef __cplusplus |
extern "C" { |
#endif |
-NO_RETURN void rtc_FatalMessage(const char* file, int line, const char* msg); |
+RTC_NO_RETURN |
+ void rtc_FatalMessage(const char* file, int line, const char* msg); |
#ifdef __cplusplus |
} // extern "C" |
#endif |
@@ -232,7 +240,7 @@ class FatalMessage { |
FatalMessage(const char* file, int line); |
// Used for RTC_CHECK_EQ(), etc. Takes ownership of the given string. |
FatalMessage(const char* file, int line, std::string* result); |
- NO_RETURN ~FatalMessage(); |
+ RTC_NO_RETURN ~FatalMessage(); |
std::ostream& stream() { return stream_; } |