Index: sunpinyin/src/portability.cpp
===================================================================
--- sunpinyin.orig/src/portability.cpp	2012-03-30 17:55:51.000000000 +0800
+++ sunpinyin/src/portability.cpp	2012-03-30 17:59:24.869968967 +0800
@@ -265,26 +265,4 @@
     return sz;
 }
 
-#if !defined (HAVE_STRNDUP)
-extern "C" char *
-strndup(const char *s, size_t n)
-{
-    size_t nMost;
-    char *p = NULL;
-
-    if (!s)
-        return NULL;
-
-#ifdef __cplusplus
-    nMost = std::min(strlen(s) + 1, n + 1);
-#else
-    nMost = min(strlen(s) + 1, n + 1);
-#endif
-    p = (char*)malloc(nMost);
-    memcpy(p, s, nMost);
-    p[nMost - 1] = '\0';
-
-    return p;
-}
-#endif //HAVE_STRNDUP
 
Index: sunpinyin/src/portability.h
===================================================================
--- sunpinyin.orig/src/portability.h	2012-03-30 17:55:51.000000000 +0800
+++ sunpinyin/src/portability.h	2012-03-30 18:01:23.390556674 +0800
@@ -326,8 +326,4 @@
 }
 #endif
 
-#if !defined (HAVE_STRNDUP)
-extern "C" char *strndup(const char *s, size_t n);
-#endif //HAVE_STRNDUP
-
 #endif
