summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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.
*/