X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f1b63efe8993c6c0460354bc2da7331526d43efa..be8b43858c480325553a66a43c9fcd92d036b885:/include/wx/wxcrtbase.h diff --git a/include/wx/wxcrtbase.h b/include/wx/wxcrtbase.h index 45cb175d69..27aafc6e8b 100644 --- a/include/wx/wxcrtbase.h +++ b/include/wx/wxcrtbase.h @@ -225,36 +225,47 @@ WXDLLIMPEXP_BASE void *calloc( size_t num, size_t size ); /* Not all compilers have strnlen(); e.g. MSVC 6.x and 7.x don't have it */ #if wxCHECK_VISUALC_VERSION(8) || defined(HAVE_STRNLEN) #define wxCRT_StrnlenA strnlen +#endif + +#if wxCHECK_VISUALC_VERSION(8) || defined(HAVE_WCSNLEN) #define wxCRT_StrnlenW wcsnlen #endif /* define wxCRT_StricmpA/W and wxCRT_StrnicmpA/W for various compilers */ -/* note that we definitely are going to need our own version for widechar - * versions */ -#if !defined(wxCRT_StricmpA) - #if defined(__BORLANDC__) || defined(__WATCOMC__) || \ - defined(__VISAGECPP__) || \ - defined(__EMX__) || defined(__DJGPP__) - #define wxCRT_StricmpA stricmp - #define wxCRT_StrnicmpA strnicmp - #elif defined(__WXPALMOS__) - /* FIXME: There is no equivalent to strnicmp in the Palm OS API. This - * quick hack should do until one can be written. - */ - #define wxCRT_StricmpA StrCaselessCompare - #define wxCRT_StrnicmpA StrNCaselessCompare - #elif defined(__SYMANTEC__) || defined(__VISUALC__) || \ - (defined(__MWERKS__) && defined(__INTEL__)) - #define wxCRT_StricmpA _stricmp - #define wxCRT_StrnicmpA _strnicmp - #elif defined(__UNIX__) || defined(__GNUWIN32__) - #define wxCRT_StricmpA strcasecmp - #define wxCRT_StrnicmpA strncasecmp - /* #else -- use wxWidgets implementation */ +#if defined(__BORLANDC__) || defined(__WATCOMC__) || \ + defined(__VISAGECPP__) || \ + defined(__EMX__) || defined(__DJGPP__) + #define wxCRT_StricmpA stricmp + #define wxCRT_StrnicmpA strnicmp +#elif defined(__WXPALMOS__) + /* FIXME: There is no equivalent to strnicmp in the Palm OS API. This + * quick hack should do until one can be written. + */ + #define wxCRT_StricmpA StrCaselessCompare + #define wxCRT_StrnicmpA StrNCaselessCompare +#elif defined(__SYMANTEC__) || defined(__VISUALC__) || \ + (defined(__MWERKS__) && defined(__INTEL__)) + #define wxCRT_StricmpA _stricmp + #define wxCRT_StrnicmpA _strnicmp +#elif defined(__UNIX__) || defined(__GNUWIN32__) + #define wxCRT_StricmpA strcasecmp + #define wxCRT_StrnicmpA strncasecmp +/* #else -- use wxWidgets implementation */ +#endif + +#ifdef __VISUALC__ + #define wxCRT_StricmpW _wcsicmp + #define wxCRT_StrnicmpW _wcsnicmp +#elif defined(__UNIX__) + #ifdef HAVE_WCSCASECMP + #define wxCRT_StricmpW wcscasecmp + #endif + #ifdef HAVE_WCSNCASECMP + #define wxCRT_StrnicmpW wcsncasecmp #endif -#endif /* !defined(wxCRT_StricmpA) */ -/* FIXME-UTF8: use wcs(n)casecmp if available for *W versions */ +/* #else -- use wxWidgets implementation */ +#endif #ifdef HAVE_STRTOK_R #define wxCRT_StrtokA(str, sep, last) strtok_r(str, sep, last)