libiberty: sync with gcc

Import the following commits from GCC as of r16-614-g9d039eff453f77:
	31dd621796f libiberty: add ldirname function
	f3d07779fdb libiberty: Append <libgen.h> to AC_CHECK_DECLS [PR119218].
	90183362524 libiberty, gcc: Add memrchr to libiberty and use it [PR119283].
	43717ee9064 libiberty: Fix off-by-one when collecting range expression
This commit is contained in:
Andreas Schwab
2025-05-14 12:44:08 +02:00
parent 50095e9492
commit c671850a83
12 changed files with 261 additions and 17 deletions

View File

@@ -133,6 +133,18 @@ extern const char *dos_lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIB
extern const char *unix_lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
/* A dirname () that is always compiled in. */
extern char *ldirname (const char *) ATTRIBUTE_NONNULL(1);
/* Same, but assumes DOS semantics regardless of host. */
extern char *dos_ldirname (const char *) ATTRIBUTE_NONNULL(1);
/* Same, but assumes Unix semantics regardless of host. */
extern char *unix_ldirname (const char *) ATTRIBUTE_NONNULL(1);
/* A well-defined realpath () that is always compiled in. */
extern char *lrealpath (const char *);
@@ -199,6 +211,16 @@ extern int fdmatch (int fd1, int fd2);
extern int ffs(int);
#endif
#if defined (HAVE_DECL_MKSTEMPS) && !HAVE_DECL_MKSTEMPS
extern int mkstemps(char *, int);
#endif
/* Make memrchr available on systems that do not have it. */
#if !defined (__GNU_LIBRARY__ ) && !defined (__linux__) && \
!defined (HAVE_MEMRCHR)
extern void *memrchr(const void *, int, size_t);
#endif
/* Get the working directory. The result is cached, so don't call
chdir() between calls to getpwd(). */