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

Unified Diff: util/stdlib/strnlen.cc

Issue 1109273002: mac: Suppress partial availability warnings. (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad.git@master
Patch Set: Comments from mark, round two. Created 5 years, 8 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 | « util/mach/exception_types.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « util/mach/exception_types.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698