@@ -23,104 +23,77 @@ else version (TVOS)
2323else version (WatchOS)
2424 version = Darwin;
2525
26+ // Those libs don't expose the mandated C interface
27+ version (CRuntime_Glibc )
28+ version = ReturnStrerrorR;
29+ else version (CRuntime_UClibc )
30+ version = ReturnStrerrorR;
31+
2632extern (C ):
2733@system :
2834nothrow :
2935@nogc :
3036
3137// /
32- pure void * memchr(return const void * s, int c, size_t n);
38+ void * memchr (return const void * s, int c, size_t n) pure ;
3339// /
34- pure int memcmp(scope const void * s1, scope const void * s2, size_t n);
40+ int memcmp (scope const void * s1, scope const void * s2, size_t n) pure ;
3541// /
36- pure void * memcpy(return void * s1, scope const void * s2, size_t n);
42+ void * memcpy (return void * s1, scope const void * s2, size_t n) pure ;
3743version (Windows )
3844{
3945 // /
4046 int memicmp (scope const char * s1, scope const char * s2, size_t n);
4147}
4248// /
43- pure void * memmove(return void * s1, scope const void * s2, size_t n);
49+ void * memmove (return void * s1, scope const void * s2, size_t n) pure ;
4450// /
45- pure void * memset(return void * s, int c, size_t n);
51+ void * memset (return void * s, int c, size_t n) pure ;
4652
4753// /
48- pure char * strcpy(return char * s1, scope const char * s2);
49- // /
50- pure char * strncpy(return char * s1, scope const char * s2, size_t n);
54+ char * strcat (return char * s1, scope const char * s2) pure ;
5155// /
52- pure char * strcat (return char * s1, scope const char * s2) ;
56+ inout ( char ) * strchr (return inout ( char ) * s, int c) pure ;
5357// /
54- pure char * strncat(return char * s1, scope const char * s2, size_t n);
55- // /
56- pure int strcmp(scope const char * s1, scope const char * s2);
58+ int strcmp (scope const char * s1, scope const char * s2) pure ;
5759// /
5860int strcoll (scope const char * s1, scope const char * s2);
5961// /
60- pure int strncmp(scope const char * s1, scope const char * s2, size_t n);
61- // /
62- size_t strxfrm (scope char * s1, scope const char * s2, size_t n);
62+ char * strcpy (return char * s1, scope const char * s2) pure ;
6363// /
64- pure inout ( char ) * strchr( return inout ( char ) * s, int c) ;
64+ size_t strcspn ( scope const char * s1, scope const char * s2) pure ;
6565// /
66- pure size_t strcspn(scope const char * s1, scope const char * s2);
67- // /
68- pure inout (char )* strpbrk(return inout (char )* s1, scope const char * s2);
69- // /
70- pure inout (char )* strrchr(return inout (char )* s, int c);
71- // /
72- pure size_t strspn(scope const char * s1, scope const char * s2);
73- // /
74- pure inout (char )* strstr(return inout (char )* s1, scope const char * s2);
75- // /
76- char * strtok (return char * s1, scope const char * s2);
66+ char * strdup (scope const char * s);
7767// /
7868char * strerror (int errnum);
79- version (CRuntime_Glibc )
69+ // This `strerror_r` definition is not following the POSIX standard
70+ version (ReturnStrerrorR)
8071{
8172 // /
8273 const (char )* strerror_r (int errnum, return char * buf, size_t buflen);
8374}
84- else version (Darwin)
85- {
86- int strerror_r (int errnum, scope char * buf, size_t buflen);
87- }
88- else version (FreeBSD )
89- {
90- int strerror_r (int errnum, scope char * buf, size_t buflen);
91- }
92- else version (NetBSD )
93- {
94- int strerror_r (int errnum, char * buf, size_t buflen);
95- }
96- else version (OpenBSD )
97- {
98- int strerror_r (int errnum, scope char * buf, size_t buflen);
99- }
100- else version (DragonFlyBSD )
75+ // This one is
76+ else
10177{
10278 int strerror_r (int errnum, scope char * buf, size_t buflen);
10379}
104- else version (Solaris )
105- {
106- int strerror_r (int errnum, scope char * buf, size_t buflen);
107- }
108- else version (CRuntime_Bionic )
109- {
110- // /
111- int strerror_r (int errnum, scope char * buf, size_t buflen);
112- }
113- else version (CRuntime_Musl )
114- {
115- // /
116- int strerror_r (int errnum, scope char * buf, size_t buflen);
117- }
118- else version (CRuntime_UClibc )
119- {
120- // /
121- const (char )* strerror_r (int errnum, return char * buf, size_t buflen);
122- }
12380// /
124- pure size_t strlen(scope const char * s);
81+ size_t strlen (scope const char * s) pure ;
12582// /
126- char * strdup (scope const char * s);
83+ char * strncat (return char * s1, scope const char * s2, size_t n) pure ;
84+ // /
85+ int strncmp (scope const char * s1, scope const char * s2, size_t n) pure ;
86+ // /
87+ char * strncpy (return char * s1, scope const char * s2, size_t n) pure ;
88+ // /
89+ inout (char )* strpbrk (return inout (char )* s1, scope const char * s2) pure ;
90+ // /
91+ inout (char )* strrchr (return inout (char )* s, int c) pure ;
92+ // /
93+ size_t strspn (scope const char * s1, scope const char * s2) pure ;
94+ // /
95+ inout (char )* strstr (return inout (char )* s1, scope const char * s2) pure ;
96+ // /
97+ char * strtok (return char * s1, scope const char * s2);
98+ // /
99+ size_t strxfrm (scope char * s1, scope const char * s2, size_t n);
0 commit comments