diff options
| author | sin | 2015-04-01 12:41:08 +0100 |
|---|---|---|
| committer | sin | 2015-04-01 12:41:08 +0100 |
| commit | 73839e34a644fc95a9bc44603025b75aee74ef5b (patch) | |
| tree | 1847f09582ad0ce9452c8d72ea41a4e6f8829906 /include/wchar.h | |
| parent | 739ec00a0230c1b94b09750c2f1c0c095fce0295 (diff) | |
Add feature-test guards for mbsnrtowcs() and wcsnrtombs()
Diffstat (limited to 'include/wchar.h')
| -rw-r--r-- | include/wchar.h | 10 |
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"); |
| 42 | extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) | 43 | extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) |
| 43 | size_t mbsnrtowcs(wchar_t *d, const char **s, size_t n, size_t wn, mbstate_t *st) | 44 | size_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"); |
| 62 | extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) | 64 | extern __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"); |
| 149 | extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) | 154 | extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) |
| 150 | size_t wcsnrtombs(char *d, const wchar_t **s, size_t wn, size_t n, mbstate_t *st) | 155 | size_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"); |
| 169 | extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) | 175 | extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) |
