[git commit] wchar.h: SuSv compliance

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Fri Jun 15 12:00:23 UTC 2012


commit: http://git.uclibc.org/uClibc/commit/?id=511f959892f039842feef9618738a8de9c860b92
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

add restrict keyword to wcsstr/wcswcs
remove restrict keyword from wmemcmp

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 include/wchar.h |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/include/wchar.h b/include/wchar.h
index 78a8344..aee2b6e 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -133,11 +133,11 @@ __BEGIN_NAMESPACE_STD
 /* This incomplete type is defined in <time.h> but needed here because
    of `wcsftime'.  */
 struct tm;
+__END_NAMESPACE_STD
 /* XXX We have to clean this up at some point.  Since tm is in the std
    namespace but wcsftime is in __c99 the type wouldn't be found
    without inserting it in the global namespace.  */
 __USING_NAMESPACE_STD(tm)
-__END_NAMESPACE_STD
 
 
 __BEGIN_NAMESPACE_C99
@@ -257,7 +257,8 @@ extern wchar_t *wcspbrk (__const wchar_t *__wcs, __const wchar_t *__accept)
      __THROW __attribute_pure__;
 libc_hidden_proto(wcspbrk)
 /* Find the first occurrence of NEEDLE in HAYSTACK.  */
-extern wchar_t *wcsstr (__const wchar_t *__haystack, __const wchar_t *__needle)
+/* SuSv uses restrict keyword, glibc does not */
+extern wchar_t *wcsstr (__const wchar_t *__restrict __haystack, __const wchar_t *__restrict __needle)
      __THROW __attribute_pure__;
 
 /* Divide WCS into tokens separated by characters in DELIM.  */
@@ -272,7 +273,9 @@ __END_NAMESPACE_C99
 
 #if defined __USE_XOPEN && defined __UCLIBC_SUSV3_LEGACY__
 /* Another name for `wcsstr' from XPG4.  */
-extern wchar_t *wcswcs (__const wchar_t *__haystack, __const wchar_t *__needle)
+/* SuSv3 did not use restrict keyword, probably because it was marked LEGACY
+   we do to be in sync with wcsstr */
+extern wchar_t *wcswcs (__const wchar_t *__restrict __haystack, __const wchar_t *__restrict __needle)
      __THROW __attribute_pure__;
 #endif
 
@@ -291,8 +294,9 @@ extern wchar_t *wmemchr (__const wchar_t *__s, wchar_t __c, size_t __n)
 libc_hidden_proto(wmemchr)
 
 /* Compare N wide characters of S1 and S2.  */
-extern int wmemcmp (__const wchar_t *__restrict __s1,
-		    __const wchar_t *__restrict __s2, size_t __n)
+/* SuSv4 does not use restrict keyword for S1 and S2, glibc does */
+extern int wmemcmp (__const wchar_t *__s1,
+		    __const wchar_t *__s2, size_t __n)
      __THROW __attribute_pure__;
 
 /* Copy N wide characters of SRC to DEST.  */


More information about the uClibc-cvs mailing list