Index: util/stdlib/strnlen.cc |
diff --git a/util/stdlib/strnlen.cc b/util/stdlib/strnlen.cc |
index b17796bb8e439152dfd9d37c888bb6ee1cd7554d..3016bf63efa4970fc7b7f6da964fd8659fb57faa 100644 |
--- a/util/stdlib/strnlen.cc |
+++ b/util/stdlib/strnlen.cc |
@@ -14,9 +14,18 @@ |
#include "util/stdlib/strnlen.h" |
+#if defined(OS_MACOSX) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 |
+ |
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 |
+// Redeclare a method only available on OSX 10.7+ to suppress a |
+// -Wpartial-availability warning. |
+extern "C" { |
+size_t strnlen(const char* string, size_t max_length); |
+} // extern "C" |
+#endif |
+ |
namespace crashpad { |
-#if defined(OS_MACOSX) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 |
size_t strnlen(const char* string, size_t max_length) { |
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 |
if (::strnlen) { |
@@ -32,6 +41,7 @@ size_t strnlen(const char* string, size_t max_length) { |
return max_length; |
} |
-#endif |
} // namespace crashpad |
+ |
+#endif |