From e407285fb1c3842546df903207f783d604465c50 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Wed, 3 Dec 2008 00:36:31 +0000 Subject: [PATCH] * src/bin/evil_test_gettimeofday.c: replace evil_gettimeofday by gettimeofday * src/lib/evil_string.c: * src/lib/evil_string.h: add strcoll() "port" to Windows CE OS. Note it's just strcmp, no locale stuff is used onn that OS. SVN revision: 37910 --- legacy/evil/ChangeLog | 10 +++++++ legacy/evil/src/bin/evil_test_gettimeofday.c | 4 +-- legacy/evil/src/lib/evil_string.c | 30 ++++++++++++++++++++ legacy/evil/src/lib/evil_string.h | 12 ++++++++ 4 files changed, 54 insertions(+), 2 deletions(-) diff --git a/legacy/evil/ChangeLog b/legacy/evil/ChangeLog index 34c1333e26..92829f2f66 100644 --- a/legacy/evil/ChangeLog +++ b/legacy/evil/ChangeLog @@ -1,3 +1,13 @@ +2008-12-03 Vincent Torri + + * src/bin/evil_test_gettimeofday.c: + replace evil_gettimeofday by gettimeofday + + * src/lib/evil_string.c: + * src/lib/evil_string.h: + add strcoll() "port" to Windows CE OS. Note it's + just strcmp, no locale stuff is used onn that OS. + 2008-11-29 Vincent Torri * src/lib/evil_main.c: diff --git a/legacy/evil/src/bin/evil_test_gettimeofday.c b/legacy/evil/src/bin/evil_test_gettimeofday.c index 5426c89c8d..41c9b699f9 100644 --- a/legacy/evil/src/bin/evil_test_gettimeofday.c +++ b/legacy/evil/src/bin/evil_test_gettimeofday.c @@ -17,11 +17,11 @@ test_time_tests_run(suite *s) struct timeval tp1; struct timeval tp2; - evil_gettimeofday (&tp1, NULL); + gettimeofday (&tp1, NULL); Sleep(20); - evil_gettimeofday (&tp2, NULL); + gettimeofday (&tp2, NULL); printf ("time : %ld %ld\n", tp1.tv_sec, tp1.tv_usec); printf ("time : %ld %ld\n", tp2.tv_sec, tp2.tv_usec); diff --git a/legacy/evil/src/lib/evil_string.c b/legacy/evil/src/lib/evil_string.c index 321c18087c..7008ef8e98 100644 --- a/legacy/evil/src/lib/evil_string.c +++ b/legacy/evil/src/lib/evil_string.c @@ -45,3 +45,33 @@ int ffs(int i) } #endif /* ! __CEGCC__ */ + + +#ifdef _WIN32_WCE + +/* + * String manipulation related functions + * + */ + +int +strcoll (const char *s1, const char *s2) +{ +#ifdef UNICODE + wchar_t *ws1; + wchar_t *ws2; + int res; + + ws1 = evil_char_to_wchar(s1); + ws2 = evil_char_to_wchar(s2); + res = wcscmp(ws1, ws2); + if (ws1) free(ws1); + if (ws2) free(ws2); + + return res; +#else + return strcmp(s1, s2); +#endif /* ! UNICODE */ +} + +#endif /* _WIN32_WCE */ diff --git a/legacy/evil/src/lib/evil_string.h b/legacy/evil/src/lib/evil_string.h index c5864cdb5b..aeb7c94835 100644 --- a/legacy/evil/src/lib/evil_string.h +++ b/legacy/evil/src/lib/evil_string.h @@ -25,4 +25,16 @@ EAPI int ffs(int i); #endif /* ! __CEGCC__ */ +#ifdef _WIN32_WCE + +/* + * String manipulation related functions + * + */ + +EAPI int strcoll (const char *s1, const char *s2); + +#endif /* _WIN32_WCE */ + + #endif /* __EVIL_STRING_H__ */