summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authordschuff@chromium.org <dschuff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-09 01:16:06 +0000
committerdschuff@chromium.org <dschuff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-09 01:16:06 +0000
commit0385f7bc99874a19bad60331c417c418c2dbb490 (patch)
tree23abb348012f3223c3fbd329cf3ec18b0cb95b41 /ppapi
parent97cbc718a71a537003fdd1579d4a9760edf7a8a1 (diff)
downloadchromium_src-0385f7bc99874a19bad60331c417c418c2dbb490.zip
chromium_src-0385f7bc99874a19bad60331c417c418c2dbb490.tar.gz
chromium_src-0385f7bc99874a19bad60331c417c418c2dbb490.tar.bz2
Use local strcmp in pnacl IRT shim.
This code cannot depend on libc. Gcc apparently inlines strcmp, but LLVM/clang does not, so this is needed to compile the shim with clang R=jvoung@chromium.org BUG= http://code.google.com/p/nativeclient/issues/detail?id=3063 Review URL: https://chromiumcodereview.appspot.com/11087015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160761 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_irt_shim/shim_ppapi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/shim_ppapi.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/shim_ppapi.c
index 3a7825c..f171a75 100644
--- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/shim_ppapi.c
+++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/shim_ppapi.c
@@ -15,6 +15,12 @@
/* The PNaCl PPAPI shims are only needed on x86-64. */
#if defined(__x86_64__)
+/* Use local strcmp to avoid dependency on libc. */
+static int mystrcmp(const char* s1, const char *s2) {
+ while((*s1 && *s2) && (*s1++ == *s2++));
+ return *(--s1) - *(--s2);
+}
+
TYPE_nacl_irt_query __pnacl_real_irt_interface;
/*
@@ -77,7 +83,7 @@ size_t __pnacl_irt_interface_wrapper(const char *interface_ident,
* attempting to do this simultaneously, which should not be a problem,
* as they are writing the same values.
*/
- if (0 != strcmp(interface_ident, NACL_IRT_PPAPIHOOK_v0_1)) {
+ if (0 != mystrcmp(interface_ident, NACL_IRT_PPAPIHOOK_v0_1)) {
/*
* The interface is not wrapped, so use the real interface.
*/