summaryrefslogtreecommitdiff
path: root/wince/stdlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'wince/stdlib.c')
-rw-r--r--wince/stdlib.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/wince/stdlib.c b/wince/stdlib.c
index a2ac340de4..d371b12f88 100644
--- a/wince/stdlib.c
+++ b/wince/stdlib.c
@@ -37,3 +37,21 @@ int mblen(const char *mbstr, size_t count)
return n;
}
+
+void *bsearch( const void *key, const void *base,
+ size_t num, size_t width,
+ int ( __cdecl *compare )(const void *, const void *))
+{
+ size_t i;
+ const void* p = base;
+ const char* px;
+
+ for( i=0; i<num; i++ )
+ {
+ if( 0==compare( key, p ) )
+ return (void*)p;
+ px = (const char*)p; px+=width; p=(const void*)px;
+ }
+ return NULL;
+}
+