diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/string.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/string.h b/include/string.h index 5309cbc..699fa8a 100644 --- a/include/string.h +++ b/include/string.h | |||
| @@ -12,8 +12,6 @@ extern "C" { | |||
| 12 | #undef memcpy | 12 | #undef memcpy |
| 13 | #undef memmove | 13 | #undef memmove |
| 14 | #undef memset | 14 | #undef memset |
| 15 | #undef stpcpy | ||
| 16 | #undef stpncpy | ||
| 17 | #undef strcat | 15 | #undef strcat |
| 18 | #undef strcpy | 16 | #undef strcpy |
| 19 | #undef strncat | 17 | #undef strncat |
| @@ -59,6 +57,10 @@ void *memset(void *dest, int c, size_t n) | |||
| 59 | return __memset_orig(dest, c, n); | 57 | return __memset_orig(dest, c, n); |
| 60 | } | 58 | } |
| 61 | 59 | ||
| 60 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ | ||
| 61 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ | ||
| 62 | || defined(_BSD_SOURCE) | ||
| 63 | #undef stpcpy | ||
| 62 | __typeof__(stpcpy) __stpcpy_orig __asm__(__USER_LABEL_PREFIX__ "stpcpy"); | 64 | __typeof__(stpcpy) __stpcpy_orig __asm__(__USER_LABEL_PREFIX__ "stpcpy"); |
| 63 | extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) | 65 | extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) |
| 64 | char *stpcpy(char *dest, const char *src) | 66 | char *stpcpy(char *dest, const char *src) |
| @@ -70,6 +72,7 @@ char *stpcpy(char *dest, const char *src) | |||
| 70 | return __stpcpy_orig(dest, src); | 72 | return __stpcpy_orig(dest, src); |
| 71 | } | 73 | } |
| 72 | 74 | ||
| 75 | #undef stpncpy | ||
| 73 | __typeof__(stpncpy) __stpncpy_orig __asm__(__USER_LABEL_PREFIX__ "stpncpy"); | 76 | __typeof__(stpncpy) __stpncpy_orig __asm__(__USER_LABEL_PREFIX__ "stpncpy"); |
| 74 | extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) | 77 | extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) |
| 75 | char *stpncpy(char *dest, const char *src, size_t n) | 78 | char *stpncpy(char *dest, const char *src, size_t n) |
| @@ -80,6 +83,7 @@ char *stpncpy(char *dest, const char *src, size_t n) | |||
| 80 | __builtin_trap(); | 83 | __builtin_trap(); |
| 81 | return __stpncpy_orig(dest, src, n); | 84 | return __stpncpy_orig(dest, src, n); |
| 82 | } | 85 | } |
| 86 | #endif | ||
| 83 | 87 | ||
| 84 | __typeof__(strcat) __strcat_orig __asm__(__USER_LABEL_PREFIX__ "strcat"); | 88 | __typeof__(strcat) __strcat_orig __asm__(__USER_LABEL_PREFIX__ "strcat"); |
| 85 | extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) | 89 | extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) |
