Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Unified Diff: webrtc/rtc_base/checks.h

Issue 3007253002: Remove typedefs.h from webrtc/ root (part 1)
Patch Set: backwards compatible FALLTHROUGH #define Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/rtc_base/arch.h ('k') | webrtc/rtc_base/checks.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_; }
« no previous file with comments | « webrtc/rtc_base/arch.h ('k') | webrtc/rtc_base/checks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698