Windows2003-3790/inetcore/outlookexpress/wabw/wabapi/_memcpy.h
2020-09-30 16:53:55 +02:00

24 lines
585 B
C

/*
* MemCopy()
*
* A much safer version of memcpy that checks the value of the byte
* count before calling the memcpy() function. This macro is only built
* into the 16 bit non-debug builds.
*/
#ifndef __MEMCPY_H_
#define __MEMCPY_H_
#if defined(WIN16) && !defined(DEBUG)
#define MemCopy(_dst,_src,_cb) do \
{ \
size_t __cb = (size_t)(_cb); \
if (__cb) \
memcpy(_dst,_src,__cb); \
} while (FALSE)
#else
#define MemCopy(_dst,_src,_cb) memcpy(_dst,_src,(size_t)(_cb))
#endif
#endif