msvcp90: Add inline wrappers for the memcpy_s/memmove_s/mbstowcs_s functions.

This commit is contained in:
Alexandre Julliard 2014-10-27 17:47:03 +09:00
parent 7711f494e3
commit 4b1aba754e
1 changed files with 18 additions and 3 deletions

View File

@ -562,8 +562,23 @@ typedef struct {
} complex_double; } complex_double;
#if _MSVCP_VER < 80 #if _MSVCP_VER < 80
#define memcpy_s( dst, size, src, count ) (memcpy( (dst), (src), (count) ), 0) static inline int memcpy_wrapper( void *dst, size_t size, const void *src, size_t count )
#define memmove_s( dst, size, src, count ) (memmove( (dst), (src), (count) ), 0) {
#define mbstowcs_s( ret, wcs, size, mbs, count ) (mbstowcs( (wcs), (mbs), (count) ), 0) memcpy( dst, src, count );
return 0;
}
static inline int memmove_wrapper( void *dst, size_t size, const void *src, size_t count )
{
memmove( dst, src, count );
return 0;
}
static inline int mbstowcs_wrapper( size_t *ret, wchar_t *wcs, size_t size, const char *mbs, size_t count )
{
mbstowcs( wcs, mbs, count );
return 0;
}
#define memcpy_s( dst, size, src, count ) memcpy_wrapper( dst, size, src, count )
#define memmove_s( dst, size, src, count ) memmove_wrapper( dst, size, src, count )
#define mbstowcs_s( ret, wcs, size, mbs, count ) mbstowcs_wrapper( ret, wcs, size, mbs, count )
#define hypotf( x, y ) ((float)hypot( (double)(x), (double)(y) )) #define hypotf( x, y ) ((float)hypot( (double)(x), (double)(y) ))
#endif #endif