diff options
-rw-r--r-- | webrtc/base/common.cc | 8 | ||||
-rw-r--r-- | webrtc/base/common.h | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/webrtc/base/common.cc b/webrtc/base/common.cc index 8ea475b0e2..c6f1b75312 100644 --- a/webrtc/base/common.cc +++ b/webrtc/base/common.cc @@ -61,4 +61,12 @@ void LogAssert(const char* function, const char* file, int line, } } +bool IsOdd(int n) { + return (n & 0x1); +} + +bool IsEven(int n) { + return !IsOdd(n); +} + } // namespace rtc diff --git a/webrtc/base/common.h b/webrtc/base/common.h index 7f4a756391..afb747d7f6 100644 --- a/webrtc/base/common.h +++ b/webrtc/base/common.h @@ -98,6 +98,10 @@ typedef void (*AssertLogger)(const char* function, // only by one component. void SetCustomAssertLogger(AssertLogger logger); +bool IsOdd(int n); + +bool IsEven(int n); + } // namespace rtc #if ENABLE_DEBUG |