Add support to provide libiberty mkstemps in gcc

2024-12-28  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

	PR target/118121
	* configure.ac: Check for mkstemps declaration.
	* configure: Regenerate.
	* config.in: Regenerate.

include/ChangeLog:

	* libiberty.h (mkstemps): Declare
This commit is contained in:
John David Anglin 2024-12-29 14:38:09 -05:00
parent 0b06abe027
commit 9fbf4a6adf
4 changed files with 13 additions and 2 deletions

View file

@ -1164,6 +1164,13 @@
#endif
/* Define to 1 if we found a declaration for 'mkstemps', otherwise define to
0. */
#ifndef USED_FOR_TARGET
#undef HAVE_DECL_MKSTEMPS
#endif
/* Define to 1 if we found a declaration for 'putchar_unlocked', otherwise
define to 0. */
#ifndef USED_FOR_TARGET

2
gcc/configure vendored
View file

@ -12153,7 +12153,7 @@ _ACEOF
for ac_func in getenv atol atoll asprintf sbrk abort atof getcwd getwd \
madvise stpcpy strnlen strsignal strverscmp \
madvise mkstemps stpcpy strnlen strsignal strverscmp \
strtol strtoul strtoll strtoull setenv unsetenv \
errno snprintf vsnprintf vasprintf malloc realloc calloc \
free getopt clock getpagesize ffs fmemopen clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked

View file

@ -1652,7 +1652,7 @@ AC_CHECK_DECLS([basename(const char*), strstr(const char*,const char*)], , ,[
#include "system.h"])
gcc_AC_CHECK_DECLS(getenv atol atoll asprintf sbrk abort atof getcwd getwd \
madvise stpcpy strnlen strsignal strverscmp \
madvise mkstemps stpcpy strnlen strsignal strverscmp \
strtol strtoul strtoll strtoull setenv unsetenv \
errno snprintf vsnprintf vasprintf malloc realloc calloc \
free getopt clock getpagesize ffs fmemopen gcc_UNLOCKED_FUNCS, , ,[

View file

@ -199,6 +199,10 @@ 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
/* Get the working directory. The result is cached, so don't call
chdir() between calls to getpwd(). */