]> git.saurik.com Git - wxWidgets.git/blob - src/msw/wince/crt.cpp
do take the toolbar into account for Windows CE, otherwise the menus overlap with...
[wxWidgets.git] / src / msw / wince / crt.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wince/crt.cpp
3 // Purpose: Implementation of CRT functions missing under Windows CE
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 03.04.04
7 // RCS-ID:
8 // Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #include "wx/msw/wince/missing.h"
13
14 #include "wx/wxprec.h"
15
16 #ifdef __BORLANDC__
17 #pragma hdrstop
18 #endif
19
20 extern "C" void *
21 bsearch(const void *key, const void *base, size_t num, size_t size,
22 int (wxCMPFUNC_CONV *cmp)(const void *, const void *))
23 {
24 int res;
25 char *mid;
26
27 char *lo = (char *)base;
28 char *hi = lo + num*size;
29 while ( lo < hi )
30 {
31 mid = lo + (hi - lo)/2;
32
33 res = (*cmp)(key, mid);
34 if ( res < 0 )
35 hi = mid;
36 else if ( res > 0 )
37 lo = mid + size;
38 else // res == 0
39 return mid;
40 }
41
42 return NULL;
43 }
44
45