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(\ ...@@ -487,8 +487,9 @@ AC_CHECK_FUNCS(\
rfork \ rfork \
sendmsg \ sendmsg \
sigaltstack \ sigaltstack \
strcasecmp \
strerror \ strerror \
stricmp \ strncasecmp \
tcgetattr \ tcgetattr \
timegm \ timegm \
usleep \ usleep \
......
...@@ -160,11 +160,14 @@ ...@@ -160,11 +160,14 @@
/* Define if you have the sigaltstack function. */ /* Define if you have the sigaltstack function. */
#undef HAVE_SIGALTSTACK #undef HAVE_SIGALTSTACK
/* Define if you have the strcasecmp function. */
#undef HAVE_STRCASECMP
/* Define if you have the strerror function. */ /* Define if you have the strerror function. */
#undef HAVE_STRERROR #undef HAVE_STRERROR
/* Define if you have the stricmp function. */ /* Define if you have the strncasecmp function. */
#undef HAVE_STRICMP #undef HAVE_STRNCASECMP
/* Define if you have the tcgetattr function. */ /* Define if you have the tcgetattr function. */
#undef HAVE_TCGETATTR #undef HAVE_TCGETATTR
......
...@@ -3,14 +3,13 @@ ...@@ -3,14 +3,13 @@
#include "windef.h" #include "windef.h"
INT16 WINAPI WideCharToLocal16(LPSTR,LPWSTR,INT16);
INT WINAPI WideCharToLocal(LPSTR,LPWSTR,INT); INT WINAPI WideCharToLocal(LPSTR,LPWSTR,INT);
INT16 WINAPI LocalToWideChar16(LPWSTR,LPSTR,INT16);
INT WINAPI LocalToWideChar(LPWSTR,LPSTR,INT); INT WINAPI LocalToWideChar(LPWSTR,LPSTR,INT);
INT WINAPI lstrncmpiA(LPCSTR,LPCSTR,INT);
LPWSTR WINAPI lstrcpyAtoW(LPWSTR,LPCSTR); LPWSTR WINAPI lstrcpyAtoW(LPWSTR,LPCSTR);
LPSTR WINAPI lstrcpyWtoA(LPSTR,LPCWSTR); LPSTR WINAPI lstrcpyWtoA(LPSTR,LPCWSTR);
LPWSTR WINAPI lstrcpynAtoW(LPWSTR,LPCSTR,INT); LPWSTR WINAPI lstrcpynAtoW(LPWSTR,LPCSTR,INT);
LPSTR WINAPI lstrcpynWtoA(LPSTR,LPCWSTR,INT); LPSTR WINAPI lstrcpynWtoA(LPSTR,LPCWSTR,INT);
#define lstrncmpiA strncasecmp
#endif /* __WINE_WINE_WINESTRING_H */ #endif /* __WINE_WINE_WINESTRING_H */
...@@ -389,23 +389,6 @@ INT WINAPI lstrlenW( LPCWSTR str ) ...@@ -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) * lstrcpyAtoW (Not a Windows API)
*/ */
LPWSTR WINAPI lstrcpyAtoW( LPWSTR dst, LPCSTR src ) LPWSTR WINAPI lstrcpyAtoW( LPWSTR dst, LPCSTR src )
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "config.h" #include "config.h"
#include <ctype.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
...@@ -104,6 +105,25 @@ int clone( int (*fn)(void *), void *stack, int flags, void *arg ) ...@@ -104,6 +105,25 @@ int clone( int (*fn)(void *), void *stack, int flags, void *arg )
#endif /* !HAVE_CLONE && __linux__ */ #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 * 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 * 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