Index: src/utils.h |
diff --git a/src/utils.h b/src/utils.h |
index c23cf05f6fa96642d9ee124c03202eb0556dac2b..2991815e576310cdf112297087b6526d24c96459 100644 |
--- a/src/utils.h |
+++ b/src/utils.h |
@@ -26,6 +26,13 @@ namespace internal { |
// ---------------------------------------------------------------------------- |
// General helper functions |
+ |
+// Same as strcmp, but can handle NULL arguments. |
+inline bool CStringEquals(const char* s1, const char* s2) { |
+ return (s1 == s2) || (s1 != NULL && s2 != NULL && strcmp(s1, s2) == 0); |
+} |
+ |
+ |
// X must be a power of 2. Returns the number of trailing zeros. |
inline int WhichPowerOf2(uint32_t x) { |
DCHECK(base::bits::IsPowerOfTwo32(x)); |