Skip to content

Commit

Permalink
Try removing problematic wcsnlen function
Browse files Browse the repository at this point in the history
This conflicts with the standard one already included through `wctype.h` in some POSIX OSes like Haiku.
  • Loading branch information
trungnt2910 committed Apr 30, 2024
1 parent f6870aa commit 56ff51f
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/coreclr/pal/inc/rt/safecrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -1088,29 +1088,6 @@ errno_t __cdecl _wcsnset_s(WCHAR *_Dst, size_t _SizeInWords, WCHAR _Value, size_

#endif

/* wcsnlen */
extern
size_t __cdecl wcsnlen(const WCHAR *inString, size_t inMaxSize);

#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL

_SAFECRT__INLINE
size_t __cdecl wcsnlen(const WCHAR *inString, size_t inMaxSize)
{
size_t n;

/* Note that we do not check if s == nullptr, because we do not
* return errno_t...
*/

for (n = 0; n < inMaxSize && *inString; n++, inString++)
;

return n;
}

#endif

/* _wmakepath_s */
_SAFECRT__EXTERN_C
errno_t __cdecl _wmakepath_s(WCHAR *_Dst, size_t _SizeInWords, const WCHAR *_Drive, const WCHAR *_Dir, const WCHAR *_Filename, const WCHAR *_Ext);
Expand Down

0 comments on commit 56ff51f

Please sign in to comment.