make wxTmemxxx() functions return char* and not void* in ANSI build for compatibility with wx 2.9 [backport of 47876 from trunk]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@47877 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1308,9 +1308,8 @@ WXDLLIMPEXP_BASE void *calloc( size_t num, size_t size );
|
|||||||
// (including even MSC) inline them just like we do right in their
|
// (including even MSC) inline them just like we do right in their
|
||||||
// headers.
|
// headers.
|
||||||
//
|
//
|
||||||
|
#include <string.h>
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
#include <string.h> //for mem funcs
|
|
||||||
|
|
||||||
//implement our own wmem variants
|
//implement our own wmem variants
|
||||||
inline wxChar* wxTmemchr(const wxChar* s, wxChar c, size_t l)
|
inline wxChar* wxTmemchr(const wxChar* s, wxChar c, size_t l)
|
||||||
{
|
{
|
||||||
@@ -1350,13 +1349,29 @@ WXDLLIMPEXP_BASE void *calloc( size_t num, size_t size );
|
|||||||
|
|
||||||
return szRet;
|
return szRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* !wxUSE_UNICODE */
|
#else /* !wxUSE_UNICODE */
|
||||||
# define wxTmemchr memchr
|
#if wxABI_VERSION >= 20805
|
||||||
# define wxTmemcmp memcmp
|
// for compatibility with earlier versions, these functions take
|
||||||
# define wxTmemcpy memcpy
|
// "void *" but in the next wx version they will take "char *" so
|
||||||
# define wxTmemmove memmove
|
// don't use them with void pointers (use the standard memxxx()
|
||||||
# define wxTmemset memset
|
// with them)
|
||||||
|
inline char* wxTmemchr(const void* s, int c, size_t len)
|
||||||
|
{ return (char*)memchr(s, c, len); }
|
||||||
|
inline int wxTmemcmp(const void* sz1, const void* sz2, size_t len)
|
||||||
|
{ return memcmp(sz1, sz2, len); }
|
||||||
|
inline char* wxTmemcpy(void* szOut, const void* szIn, size_t len)
|
||||||
|
{ return (char*)memcpy(szOut, szIn, len); }
|
||||||
|
inline char* wxTmemmove(void* szOut, const void* szIn, size_t len)
|
||||||
|
{ return (char*)memmove(szOut, szIn, len); }
|
||||||
|
inline char* wxTmemset(void* szOut, int c, size_t len)
|
||||||
|
{ return (char*)memset(szOut, c, len); }
|
||||||
|
#else
|
||||||
|
# define wxTmemchr memchr
|
||||||
|
# define wxTmemcmp memcmp
|
||||||
|
# define wxTmemcpy memcpy
|
||||||
|
# define wxTmemmove memmove
|
||||||
|
# define wxTmemset memset
|
||||||
|
#endif
|
||||||
#endif /* wxUSE_UNICODE/!wxUSE_UNICODE */
|
#endif /* wxUSE_UNICODE/!wxUSE_UNICODE */
|
||||||
|
|
||||||
#endif /*__cplusplus*/
|
#endif /*__cplusplus*/
|
||||||
|
Reference in New Issue
Block a user