mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Fix convenience macros for RtcEventLogParseStatus.
Bug: webrtc:14801 Change-Id: I56f352b9997fb6215cc04e90e50861985c22a2b4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296720 Reviewed-by: Björn Terelius <terelius@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39511}
This commit is contained in:
parent
bc992a0ba9
commit
f5127616aa
1 changed files with 25 additions and 25 deletions
|
@ -15,24 +15,24 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
|
#include "rtc_base/checks.h"
|
||||||
|
|
||||||
#define RTC_PARSE_CHECK_OR_RETURN(X) \
|
#define RTC_PARSE_CHECK_OR_RETURN(X) \
|
||||||
do { \
|
do { \
|
||||||
if (!(X)) \
|
if (!(X)) \
|
||||||
return ParsedRtcEventLog::ParseStatus::Error(#X, __FILE__, __LINE__); \
|
return RtcEventLogParseStatus::Error(#X, __FILE__, __LINE__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define RTC_PARSE_CHECK_OR_RETURN_MESSAGE(X, M) \
|
#define RTC_PARSE_CHECK_OR_RETURN_MESSAGE(X, M) \
|
||||||
do { \
|
do { \
|
||||||
if (!(X)) \
|
if (!(X)) \
|
||||||
return ParsedRtcEventLog::ParseStatus::Error((M), __FILE__, __LINE__); \
|
return RtcEventLogParseStatus::Error((M), __FILE__, __LINE__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define RTC_PARSE_CHECK_OR_RETURN_OP(OP, X, Y) \
|
#define RTC_PARSE_CHECK_OR_RETURN_OP(OP, X, Y) \
|
||||||
do { \
|
do { \
|
||||||
if (!((X)OP(Y))) \
|
if (!((X)OP(Y))) \
|
||||||
return ParsedRtcEventLog::ParseStatus::Error(#X #OP #Y, __FILE__, \
|
return RtcEventLogParseStatus::Error(#X #OP #Y, __FILE__, __LINE__); \
|
||||||
__LINE__); \
|
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define RTC_PARSE_CHECK_OR_RETURN_EQ(X, Y) \
|
#define RTC_PARSE_CHECK_OR_RETURN_EQ(X, Y) \
|
||||||
|
@ -51,20 +51,20 @@
|
||||||
#define RTC_PARSE_CHECK_OR_RETURN_GE(X, Y) \
|
#define RTC_PARSE_CHECK_OR_RETURN_GE(X, Y) \
|
||||||
RTC_PARSE_CHECK_OR_RETURN_OP(>=, X, Y)
|
RTC_PARSE_CHECK_OR_RETURN_OP(>=, X, Y)
|
||||||
|
|
||||||
#define RTC_PARSE_WARN_AND_RETURN_SUCCESS_IF(X, M) \
|
#define RTC_PARSE_WARN_AND_RETURN_SUCCESS_IF(X, M) \
|
||||||
do { \
|
do { \
|
||||||
if (X) { \
|
if (X) { \
|
||||||
RTC_LOG(LS_WARNING) << (M); \
|
RTC_LOG(LS_WARNING) << (M); \
|
||||||
return ParsedRtcEventLog::ParseStatus::Success(); \
|
return RtcEventLogParseStatus::Success(); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define RTC_RETURN_IF_ERROR(X) \
|
#define RTC_RETURN_IF_ERROR(X) \
|
||||||
do { \
|
do { \
|
||||||
const ParsedRtcEventLog::ParseStatus _rtc_parse_status(X); \
|
const RtcEventLogParseStatus _rtc_parse_status(X); \
|
||||||
if (!_rtc_parse_status.ok()) { \
|
if (!_rtc_parse_status.ok()) { \
|
||||||
return _rtc_parse_status; \
|
return _rtc_parse_status; \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
// TODO(terelius): Compared to a generic 'Status' class, this
|
// TODO(terelius): Compared to a generic 'Status' class, this
|
||||||
|
|
Loading…
Reference in a new issue