diff options
Diffstat (limited to 'gl/string.in.h')
-rw-r--r-- | gl/string.in.h | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/gl/string.in.h b/gl/string.in.h index 13c0f095..f64fce30 100644 --- a/gl/string.in.h +++ b/gl/string.in.h | |||
@@ -41,10 +41,12 @@ | |||
41 | # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) | 41 | # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) |
42 | # define __attribute__(Spec) /* empty */ | 42 | # define __attribute__(Spec) /* empty */ |
43 | # endif | 43 | # endif |
44 | #endif | ||
44 | /* The attribute __pure__ was added in gcc 2.96. */ | 45 | /* The attribute __pure__ was added in gcc 2.96. */ |
45 | # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96) | 46 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) |
46 | # define __pure__ /* empty */ | 47 | # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) |
47 | # endif | 48 | #else |
49 | # define _GL_ATTRIBUTE_PURE /* empty */ | ||
48 | #endif | 50 | #endif |
49 | 51 | ||
50 | 52 | ||
@@ -62,13 +64,13 @@ | |||
62 | # define memchr rpl_memchr | 64 | # define memchr rpl_memchr |
63 | # endif | 65 | # endif |
64 | _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n) | 66 | _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n) |
65 | __attribute__ ((__pure__)) | 67 | _GL_ATTRIBUTE_PURE |
66 | _GL_ARG_NONNULL ((1))); | 68 | _GL_ARG_NONNULL ((1))); |
67 | _GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n)); | 69 | _GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n)); |
68 | # else | 70 | # else |
69 | # if ! @HAVE_MEMCHR@ | 71 | # if ! @HAVE_MEMCHR@ |
70 | _GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n) | 72 | _GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n) |
71 | __attribute__ ((__pure__)) | 73 | _GL_ATTRIBUTE_PURE |
72 | _GL_ARG_NONNULL ((1))); | 74 | _GL_ARG_NONNULL ((1))); |
73 | # endif | 75 | # endif |
74 | /* On some systems, this function is defined as an overloaded function: | 76 | /* On some systems, this function is defined as an overloaded function: |
@@ -102,7 +104,8 @@ _GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - " | |||
102 | _GL_FUNCDECL_RPL (memmem, void *, | 104 | _GL_FUNCDECL_RPL (memmem, void *, |
103 | (void const *__haystack, size_t __haystack_len, | 105 | (void const *__haystack, size_t __haystack_len, |
104 | void const *__needle, size_t __needle_len) | 106 | void const *__needle, size_t __needle_len) |
105 | __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 3))); | 107 | _GL_ATTRIBUTE_PURE |
108 | _GL_ARG_NONNULL ((1, 3))); | ||
106 | _GL_CXXALIAS_RPL (memmem, void *, | 109 | _GL_CXXALIAS_RPL (memmem, void *, |
107 | (void const *__haystack, size_t __haystack_len, | 110 | (void const *__haystack, size_t __haystack_len, |
108 | void const *__needle, size_t __needle_len)); | 111 | void const *__needle, size_t __needle_len)); |
@@ -111,7 +114,8 @@ _GL_CXXALIAS_RPL (memmem, void *, | |||
111 | _GL_FUNCDECL_SYS (memmem, void *, | 114 | _GL_FUNCDECL_SYS (memmem, void *, |
112 | (void const *__haystack, size_t __haystack_len, | 115 | (void const *__haystack, size_t __haystack_len, |
113 | void const *__needle, size_t __needle_len) | 116 | void const *__needle, size_t __needle_len) |
114 | __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 3))); | 117 | _GL_ATTRIBUTE_PURE |
118 | _GL_ARG_NONNULL ((1, 3))); | ||
115 | # endif | 119 | # endif |
116 | _GL_CXXALIAS_SYS (memmem, void *, | 120 | _GL_CXXALIAS_SYS (memmem, void *, |
117 | (void const *__haystack, size_t __haystack_len, | 121 | (void const *__haystack, size_t __haystack_len, |
@@ -152,7 +156,7 @@ _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - " | |||
152 | #if @GNULIB_MEMRCHR@ | 156 | #if @GNULIB_MEMRCHR@ |
153 | # if ! @HAVE_DECL_MEMRCHR@ | 157 | # if ! @HAVE_DECL_MEMRCHR@ |
154 | _GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t) | 158 | _GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t) |
155 | __attribute__ ((__pure__)) | 159 | _GL_ATTRIBUTE_PURE |
156 | _GL_ARG_NONNULL ((1))); | 160 | _GL_ARG_NONNULL ((1))); |
157 | # endif | 161 | # endif |
158 | /* On some systems, this function is defined as an overloaded function: | 162 | /* On some systems, this function is defined as an overloaded function: |
@@ -182,7 +186,7 @@ _GL_WARN_ON_USE (memrchr, "memrchr is unportable - " | |||
182 | #if @GNULIB_RAWMEMCHR@ | 186 | #if @GNULIB_RAWMEMCHR@ |
183 | # if ! @HAVE_RAWMEMCHR@ | 187 | # if ! @HAVE_RAWMEMCHR@ |
184 | _GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in) | 188 | _GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in) |
185 | __attribute__ ((__pure__)) | 189 | _GL_ATTRIBUTE_PURE |
186 | _GL_ARG_NONNULL ((1))); | 190 | _GL_ARG_NONNULL ((1))); |
187 | # endif | 191 | # endif |
188 | /* On some systems, this function is defined as an overloaded function: | 192 | /* On some systems, this function is defined as an overloaded function: |
@@ -272,7 +276,7 @@ _GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings " | |||
272 | #if @GNULIB_STRCHRNUL@ | 276 | #if @GNULIB_STRCHRNUL@ |
273 | # if ! @HAVE_STRCHRNUL@ | 277 | # if ! @HAVE_STRCHRNUL@ |
274 | _GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in) | 278 | _GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in) |
275 | __attribute__ ((__pure__)) | 279 | _GL_ATTRIBUTE_PURE |
276 | _GL_ARG_NONNULL ((1))); | 280 | _GL_ARG_NONNULL ((1))); |
277 | # endif | 281 | # endif |
278 | /* On some systems, this function is defined as an overloaded function: | 282 | /* On some systems, this function is defined as an overloaded function: |
@@ -378,13 +382,13 @@ _GL_WARN_ON_USE (strndup, "strndup is unportable - " | |||
378 | # define strnlen rpl_strnlen | 382 | # define strnlen rpl_strnlen |
379 | # endif | 383 | # endif |
380 | _GL_FUNCDECL_RPL (strnlen, size_t, (char const *__string, size_t __maxlen) | 384 | _GL_FUNCDECL_RPL (strnlen, size_t, (char const *__string, size_t __maxlen) |
381 | __attribute__ ((__pure__)) | 385 | _GL_ATTRIBUTE_PURE |
382 | _GL_ARG_NONNULL ((1))); | 386 | _GL_ARG_NONNULL ((1))); |
383 | _GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen)); | 387 | _GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen)); |
384 | # else | 388 | # else |
385 | # if ! @HAVE_DECL_STRNLEN@ | 389 | # if ! @HAVE_DECL_STRNLEN@ |
386 | _GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen) | 390 | _GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen) |
387 | __attribute__ ((__pure__)) | 391 | _GL_ATTRIBUTE_PURE |
388 | _GL_ARG_NONNULL ((1))); | 392 | _GL_ARG_NONNULL ((1))); |
389 | # endif | 393 | # endif |
390 | _GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)); | 394 | _GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)); |
@@ -414,7 +418,7 @@ _GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings " | |||
414 | #if @GNULIB_STRPBRK@ | 418 | #if @GNULIB_STRPBRK@ |
415 | # if ! @HAVE_STRPBRK@ | 419 | # if ! @HAVE_STRPBRK@ |
416 | _GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept) | 420 | _GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept) |
417 | __attribute__ ((__pure__)) | 421 | _GL_ATTRIBUTE_PURE |
418 | _GL_ARG_NONNULL ((1, 2))); | 422 | _GL_ARG_NONNULL ((1, 2))); |
419 | # endif | 423 | # endif |
420 | /* On some systems, this function is defined as an overloaded function: | 424 | /* On some systems, this function is defined as an overloaded function: |
@@ -514,7 +518,7 @@ _GL_WARN_ON_USE (strsep, "strsep is unportable - " | |||
514 | # define strstr rpl_strstr | 518 | # define strstr rpl_strstr |
515 | # endif | 519 | # endif |
516 | _GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle) | 520 | _GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle) |
517 | __attribute__ ((__pure__)) | 521 | _GL_ATTRIBUTE_PURE |
518 | _GL_ARG_NONNULL ((1, 2))); | 522 | _GL_ARG_NONNULL ((1, 2))); |
519 | _GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle)); | 523 | _GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle)); |
520 | # else | 524 | # else |
@@ -556,14 +560,16 @@ _GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot " | |||
556 | # endif | 560 | # endif |
557 | _GL_FUNCDECL_RPL (strcasestr, char *, | 561 | _GL_FUNCDECL_RPL (strcasestr, char *, |
558 | (const char *haystack, const char *needle) | 562 | (const char *haystack, const char *needle) |
559 | __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2))); | 563 | _GL_ATTRIBUTE_PURE |
564 | _GL_ARG_NONNULL ((1, 2))); | ||
560 | _GL_CXXALIAS_RPL (strcasestr, char *, | 565 | _GL_CXXALIAS_RPL (strcasestr, char *, |
561 | (const char *haystack, const char *needle)); | 566 | (const char *haystack, const char *needle)); |
562 | # else | 567 | # else |
563 | # if ! @HAVE_STRCASESTR@ | 568 | # if ! @HAVE_STRCASESTR@ |
564 | _GL_FUNCDECL_SYS (strcasestr, char *, | 569 | _GL_FUNCDECL_SYS (strcasestr, char *, |
565 | (const char *haystack, const char *needle) | 570 | (const char *haystack, const char *needle) |
566 | __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2))); | 571 | _GL_ATTRIBUTE_PURE |
572 | _GL_ARG_NONNULL ((1, 2))); | ||
567 | # endif | 573 | # endif |
568 | /* On some systems, this function is defined as an overloaded function: | 574 | /* On some systems, this function is defined as an overloaded function: |
569 | extern "C++" { const char * strcasestr (const char *, const char *); } | 575 | extern "C++" { const char * strcasestr (const char *, const char *); } |