1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-05-13 15:13:36 +00:00

use _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE

This commit is contained in:
Jim Meyering
2011-04-24 19:02:10 +02:00
parent d35ef05dc0
commit 349d7fe0e3
27 changed files with 252 additions and 36 deletions

View File

@@ -22,11 +22,19 @@
#include <string.h>
/* The attribute __pure__ was added in gcc 2.96. */
#undef _GL_ATTRIBUTE_PURE
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
#else
# define _GL_ATTRIBUTE_PURE /* empty */
#endif
/* Return the address of the last file name component of NAME. If
NAME has no relative file name components because it is a file
system root, return the empty string. */
char *
char * _GL_ATTRIBUTE_PURE
last_component (char const *name)
{
char const *base = name + FILE_SYSTEM_PREFIX_LEN (name);