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

Alexandre Julliard julliard at wine.codeweavers.com
Mon Oct 27 05:36:37 CDT 2014


Module: wine
Branch: master
Commit: 4b1aba754e5aab84fe74f595fb305f5293a29589
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4b1aba754e5aab84fe74f595fb305f5293a29589

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Oct 27 17:47:03 2014 +0900

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

---

 dlls/msvcp90/msvcp90.h | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h
index 0a60d46..d7c0a31 100644
--- a/dlls/msvcp90/msvcp90.h
+++ b/dlls/msvcp90/msvcp90.h
@@ -562,8 +562,23 @@ typedef struct {
 } complex_double;
 
 #if _MSVCP_VER < 80
-#define memcpy_s( dst, size, src, count ) (memcpy( (dst), (src), (count) ), 0)
-#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)
+static inline int memcpy_wrapper( void *dst, size_t size, const void *src, size_t count )
+{
+    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) ))
 #endif




More information about the wine-cvs mailing list