Commit 3b96efc0 authored by Alexandre Julliard's avatar Alexandre Julliard

Added configure check for str[n]casecmp.

parent 23cadd37
......@@ -487,8 +487,9 @@ AC_CHECK_FUNCS(\
rfork \
sendmsg \
sigaltstack \
strcasecmp \
strerror \
stricmp \
strncasecmp \
tcgetattr \
timegm \
usleep \
......
......@@ -160,11 +160,14 @@
/* Define if you have the sigaltstack function. */
#undef HAVE_SIGALTSTACK
/* Define if you have the strcasecmp function. */
#undef HAVE_STRCASECMP
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
/* Define if you have the stricmp function. */
#undef HAVE_STRICMP
/* Define if you have the strncasecmp function. */
#undef HAVE_STRNCASECMP
/* Define if you have the tcgetattr function. */
#undef HAVE_TCGETATTR
......
......@@ -3,14 +3,13 @@
#include "windef.h"
INT16 WINAPI WideCharToLocal16(LPSTR,LPWSTR,INT16);
INT WINAPI WideCharToLocal(LPSTR,LPWSTR,INT);
INT16 WINAPI LocalToWideChar16(LPWSTR,LPSTR,INT16);
INT WINAPI LocalToWideChar(LPWSTR,LPSTR,INT);
INT WINAPI lstrncmpiA(LPCSTR,LPCSTR,INT);
LPWSTR WINAPI lstrcpyAtoW(LPWSTR,LPCSTR);
LPSTR WINAPI lstrcpyWtoA(LPSTR,LPCWSTR);
LPWSTR WINAPI lstrcpynAtoW(LPWSTR,LPCSTR,INT);
LPSTR WINAPI lstrcpynWtoA(LPSTR,LPCWSTR,INT);
#define lstrncmpiA strncasecmp
#endif /* __WINE_WINE_WINESTRING_H */
......@@ -389,23 +389,6 @@ INT WINAPI lstrlenW( LPCWSTR str )
/***********************************************************************
* lstrncmpi32A (Not a Windows API)
*/
INT WINAPI lstrncmpiA( LPCSTR str1, LPCSTR str2, INT n )
{
INT res;
TRACE("strncmpi %s and %s for %d chars\n",
debugstr_an (str1, n), debugstr_an (str2, n), n);
if (!n) return 0;
while ((--n > 0) && *str1)
if ( (res = toupper(*str1++) - toupper(*str2++)) ) return res;
return toupper(*str1) - toupper(*str2);
}
/***********************************************************************
* lstrcpyAtoW (Not a Windows API)
*/
LPWSTR WINAPI lstrcpyAtoW( LPWSTR dst, LPCSTR src )
......
......@@ -6,6 +6,7 @@
#include "config.h"
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
......@@ -104,6 +105,25 @@ int clone( int (*fn)(void *), void *stack, int flags, void *arg )
#endif /* !HAVE_CLONE && __linux__ */
#ifndef HAVE_STRCASECMP
int strcasecmp( const char *str1, const char *str2 )
{
while (*str1 && toupper(*str1) == toupper(*str2)) { str1++; str2++; }
return toupper(*str1) - toupper(*str2);
}
#endif /* HAVE_STRCASECMP */
#ifndef HAVE_STRNCASECMP
int strncasecmp( const char *str1, const char *str2, size_t n )
{
int res;
if (!n) return 0;
while ((--n > 0) && *str1)
if ((res = toupper(*str1++) - toupper(*str2++))) return res;
return toupper(*str1) - toupper(*str2);
}
#endif /* HAVE_STRNCASECMP */
/**
* It looks like the openpty that comes with glibc in RedHat 5.0
* is buggy (second call returns what looks like a dup of 0 and 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment