1. Now that we have a strnlen() implementation, I think we can also
remove the #if 0 out in tchar.h for it (I forgot doing so last time.)

2. We only have _mbstrnlen_l in msvcrt.def but we prototype both of
_mbstrnlen() and _mbstrnlen_l() in stdlib.h.  We can macroize the
former to wrap onto the latter I guess? (and should we comment out
the proto for _mbstrnlen() ?)

Is the following patch OK? Comments?

Index: stdlib.h
===================================================================
--- stdlib.h    (revision 3515)
+++ stdlib.h    (working copy)
@@ -369,6 +369,7 @@
   _CRTIMP size_t __cdecl _mbstrlen_l(const char *_Str,_locale_t _Locale);
   _CRTIMP size_t __cdecl _mbstrnlen(const char *_Str,size_t _MaxCount);
   _CRTIMP size_t __cdecl _mbstrnlen_l(const char *_Str,size_t
_MaxCount,_locale_t _Locale);
+#define _mbstrnlen(s, c) _mbstrnlen_l((s), (c), NULL)
   int __cdecl mbtowc(wchar_t * __restrict__ _DstCh,const char *
__restrict__ _SrcCh,size_t _SrcSizeInBytes);
   _CRTIMP int __cdecl _mbtowc_l(wchar_t * __restrict__ _DstCh,const
char * __restrict__ _SrcCh,size_t _SrcSizeInBytes,_locale_t _Locale);
   size_t __cdecl mbstowcs(wchar_t * __restrict__ _Dest,const char *
__restrict__ _Source,size_t _MaxCount);
Index: tchar.h
===================================================================
--- tchar.h     (revision 3515)
+++ tchar.h     (working copy)
@@ -615,9 +615,7 @@
 #define _tcscpy strcpy
 #define _tcsdup _strdup
 #define _tcslen strlen
-#if 0
 #define _tcsnlen strnlen
-#endif
 #define _tcsxfrm strxfrm
 #define _tcsxfrm_l _strxfrm_l
 #define _tcserror strerror

(against v1.0 but should apply to the trunk just the same.)

--
O.S.

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to