Commit bc78d796 authored by thakis@chromium.org's avatar thakis@chromium.org

Change talloc.c to build with the mac 10.7 SDK

talloc.c has a local diff to define strnlen(), instead of using
the definition in replace.c. However, the 10.7 SDK has its own
strnlen(), which makes the compiler complain about a strnlen()
redefinition. Use the pattern from replace.c to fix the
redefinition problem.

With this change, 'browser_tests' builds with the 10.7 SDK.

BUG=136844
TEST=none

Review URL: https://chromiumcodereview.appspot.com/10832045

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148685 0039d316-1c4b-4281-b951-d872f2087c98
parent 26121ca4
......@@ -254,7 +254,8 @@ diff -c -r talloc-2.0.1/talloc.c talloc/talloc.c
}
+ #ifndef HAVE_STRNLEN
+ static size_t strnlen(const char* s, size_t n)
+ #define strnlen rep_strnlen
+ static size_t rep_strnlen(const char* s, size_t n)
+ {
+ if (unlikely(!s)) return 0;
+ int i = 0;
......
......@@ -1594,7 +1594,8 @@ char *talloc_strdup(const void *t, const char *p)
}
#ifndef HAVE_STRNLEN
static size_t strnlen(const char* s, size_t n)
#define strnlen rep_strnlen
static size_t rep_strnlen(const char* s, size_t n)
{
if (unlikely(!s)) return 0;
int i = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment