summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorsin2015-04-01 12:41:08 +0100
committersin2015-04-01 12:41:08 +0100
commit73839e34a644fc95a9bc44603025b75aee74ef5b (patch)
tree1847f09582ad0ce9452c8d72ea41a4e6f8829906 /include
parent739ec00a0230c1b94b09750c2f1c0c095fce0295 (diff)
Add feature-test guards for mbsnrtowcs() and wcsnrtombs()
Diffstat (limited to 'include')
-rw-r--r--include/wchar.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/wchar.h b/include/wchar.h
index aba1bd8..e2d56e8 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -11,7 +11,6 @@ extern "C" {
11#endif 11#endif
12 12
13#undef fgetws 13#undef fgetws
14#undef mbsnrtowcs
15#undef mbsrtowcs 14#undef mbsrtowcs
16#undef mbstowcs 15#undef mbstowcs
17#undef wcrtomb 16#undef wcrtomb
@@ -19,7 +18,6 @@ extern "C" {
19#undef wcscpy 18#undef wcscpy
20#undef wcsncat 19#undef wcsncat
21#undef wcsncpy 20#undef wcsncpy
22#undef wcsnrtombs
23#undef wcsrtombs 21#undef wcsrtombs
24#undef wcstombs 22#undef wcstombs
25#undef wctomb 23#undef wctomb
@@ -38,6 +36,9 @@ wchar_t *fgetws(wchar_t *s, int n, FILE *fp)
38 return __fgetws_orig(s, n, fp); 36 return __fgetws_orig(s, n, fp);
39} 37}
40 38
39#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
40 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
41#undef mbsnrtowcs
41__typeof__(mbsnrtowcs) __mbsnrtowcs_orig __asm__(__USER_LABEL_PREFIX__ "mbsnrtowcs"); 42__typeof__(mbsnrtowcs) __mbsnrtowcs_orig __asm__(__USER_LABEL_PREFIX__ "mbsnrtowcs");
42extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) 43extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__))
43size_t mbsnrtowcs(wchar_t *d, const char **s, size_t n, size_t wn, mbstate_t *st) 44size_t mbsnrtowcs(wchar_t *d, const char **s, size_t n, size_t wn, mbstate_t *st)
@@ -57,6 +58,7 @@ size_t mbsnrtowcs(wchar_t *d, const char **s, size_t n, size_t wn, mbstate_t *st
57 } 58 }
58 return r; 59 return r;
59} 60}
61#endif
60 62
61__typeof__(mbsrtowcs) __mbsrtowcs_orig __asm__(__USER_LABEL_PREFIX__ "mbsrtowcs"); 63__typeof__(mbsrtowcs) __mbsrtowcs_orig __asm__(__USER_LABEL_PREFIX__ "mbsrtowcs");
62extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) 64extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__))
@@ -145,6 +147,9 @@ wchar_t *wcsncpy(wchar_t *d, const wchar_t *s, size_t n)
145 return __wcsncpy_orig(d, s, n); 147 return __wcsncpy_orig(d, s, n);
146} 148}
147 149
150#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
151 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
152#undef wcsnrtombs
148__typeof__(wcsnrtombs) __wcsnrtombs_orig __asm__(__USER_LABEL_PREFIX__ "wcsnrtombs"); 153__typeof__(wcsnrtombs) __wcsnrtombs_orig __asm__(__USER_LABEL_PREFIX__ "wcsnrtombs");
149extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) 154extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__))
150size_t wcsnrtombs(char *d, const wchar_t **s, size_t wn, size_t n, mbstate_t *st) 155size_t wcsnrtombs(char *d, const wchar_t **s, size_t wn, size_t n, mbstate_t *st)
@@ -164,6 +169,7 @@ size_t wcsnrtombs(char *d, const wchar_t **s, size_t wn, size_t n, mbstate_t *st
164 } 169 }
165 return r; 170 return r;
166} 171}
172#endif
167 173
168__typeof__(wcsrtombs) __wcsrtombs_orig __asm__(__USER_LABEL_PREFIX__ "wcsrtombs"); 174__typeof__(wcsrtombs) __wcsrtombs_orig __asm__(__USER_LABEL_PREFIX__ "wcsrtombs");
169extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) 175extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__))