mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 06:05:48 +00:00
[UCRT] Import Microsoft.Windows.SDK.CRTSource version 10.0.22621.3
Imported from https://www.nuget.org/packages/Microsoft.Windows.SDK.CRTSource/10.0.22621.3 License: MIT
This commit is contained in:
parent
f1b60c66f0
commit
04e0dc4a7a
568 changed files with 115483 additions and 0 deletions
49
sdk/lib/ucrt/mbstring/mbclen.cpp
Normal file
49
sdk/lib/ucrt/mbstring/mbclen.cpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
/***
|
||||
*mbclen.c - Find length of MBCS character
|
||||
*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
*
|
||||
*Purpose:
|
||||
* Find length of MBCS character
|
||||
*
|
||||
*******************************************************************************/
|
||||
#ifndef _MBCS
|
||||
#error This file should only be compiled with _MBCS defined
|
||||
#endif
|
||||
|
||||
#include <corecrt_internal_mbstring.h>
|
||||
#include <locale.h>
|
||||
|
||||
#pragma warning(disable:__WARNING_POTENTIAL_BUFFER_OVERFLOW_NULLTERMINATED) // 26018
|
||||
|
||||
/***
|
||||
* _mbclen - Find length of MBCS character
|
||||
*
|
||||
*Purpose:
|
||||
* Find the length of the MBCS character (in bytes).
|
||||
*
|
||||
*Entry:
|
||||
* unsigned char *c = MBCS character
|
||||
*
|
||||
*Exit:
|
||||
* Returns the number of bytes in the MBCS character
|
||||
*
|
||||
*Exceptions:
|
||||
*
|
||||
*******************************************************************************/
|
||||
|
||||
extern "C" size_t __cdecl _mbclen_l(unsigned char const* c, _locale_t locale)
|
||||
{
|
||||
/* Don't return two if we have leadbyte, EOS.
|
||||
Don't assert here; too low level
|
||||
*/
|
||||
return ((_ismbblead_l)(*c, locale) && c[1] != '\0') ? 2 : 1;
|
||||
}
|
||||
|
||||
extern "C" size_t __cdecl _mbclen(unsigned char const* c)
|
||||
{
|
||||
/* Don't return two if we have leadbyte, EOS.
|
||||
Don't assert here; too low level
|
||||
*/
|
||||
return (_ismbblead(*c) && c[1]!='\0') ? 2 : 1;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue