mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-27 03:43:36 +00:00
JIRA issue: CORE-20617 @learn-more found #9157 breaks the build as follows: > error C2220: the following warning is treated as an error > warning C4163: 'strncmp': not available as an intrinsic function > warning C4163: 'strncpy': not available as an intrinsic function _MSC_VER=1932 was not the version that the intrinsic functions (strncmp, strncpy, wcsncmp, wcsncpy) added. Using Compiler Explorer could detect the correct version: _MSC_VER=1950.
31 lines
425 B
C
31 lines
425 B
C
|
|
#include <stddef.h>
|
|
#include <tchar.h>
|
|
|
|
#if defined(_MSC_VER) && (defined(_M_ARM) || _MSC_VER >= 1950)
|
|
#pragma function(_tcsncpy)
|
|
#endif /* _MSC_VER */
|
|
|
|
_TCHAR * _tcsncpy(_TCHAR * dst, const _TCHAR * src, size_t n)
|
|
{
|
|
if(n != 0)
|
|
{
|
|
_TCHAR * d = dst;
|
|
const _TCHAR * s = src;
|
|
|
|
do
|
|
{
|
|
if((*d ++ = *s ++) == 0)
|
|
{
|
|
while (-- n != 0) *d ++ = 0;
|
|
break;
|
|
}
|
|
}
|
|
while(-- n != 0);
|
|
}
|
|
|
|
return dst;
|
|
}
|
|
|
|
/* EOF */
|