1
0
Fork 0

[mkstemps] Check for mkstemps function

musl has it, but it was not detected
This commit is contained in:
Witold Filipczyk 2022-01-06 19:51:18 +01:00
parent d974da9160
commit 4658ae9ca5
4 changed files with 14 additions and 1 deletions

View File

@ -822,6 +822,9 @@
/* Define to 1 if you have the `__argz_stringify' function. */
#mesondefine HAVE___ARGZ_STRINGIFY
/* Define to 1 if you have the `mkstemps' function. */
#mesondefine HAVE_MKSTEMPS
/* Define as const if the declaration of iconv() needs const. */
#mesondefine ICONV_CONST
@ -916,6 +919,11 @@
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
/* Enable DEFAULT_SOURCE */
#ifndef _DEFAULT_SOURCE
# define _DEFAULT_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS

View File

@ -324,6 +324,7 @@ AC_CHECK_FUNCS(geteuid, HAVE_GETEUID=yes)
AC_CHECK_FUNCS(wcwidth, HAVE_WCWIDTH=yes)
AC_CHECK_FUNCS(fork)
AC_CHECK_FUNCS(mkstemps)
# These aren't probably needed now, as they are commented in links.h.
# I've no idea about their historical background, but I keep them here

View File

@ -689,6 +689,10 @@ if compiler.has_function('gnutls_certificate_set_x509_system_trust', prefix: '#i
conf_data.set('HAVE_GNUTLS_CERTIFICATE_SET_X509_SYSTEM_TRUST', 1)
endif
if compiler.has_function('mkstemps', prefix: '#include <stdlib.h>', args: '-D_GNU_SOURCE')
conf_data.set('HAVE_MKSTEMPS', 1)
endif
conf_data.set('ICONV_CONST', true)
sysconfdir = get_option('prefix') / get_option('sysconfdir')/'elinks'

View File

@ -1019,7 +1019,7 @@ get_system_str(int xwin)
return xwin ? SYSTEM_STR "-xwin" : SYSTEM_STR;
}
#if _DEFAULT_SOURCE || _SVID_SOURCE || _BSD_SOURCE
#ifdef HAVE_MKSTEMPS
/* tempnam() replacement without races */