Commit e9ebc6b2 authored by Rafaël Carré's avatar Rafaël Carré

(v)asprintf : don't use AC_REPLACE_FUNCS

Use our own check which also recognizes static inline functions
(cherry picked from commit 84a1a346)

Conflicts:

	configure.ac
parent 8c486142
......@@ -516,11 +516,26 @@ need_libc=false
dnl Check for usual libc functions
AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r if_nameindex if_nametoindex isatty lstat memalign mmap openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
AC_REPLACE_FUNCS([asprintf atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r inet_pton lldiv localtime_r nrand48 rewind setenv strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdestroy vasprintf])
AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r inet_pton lldiv localtime_r nrand48 rewind setenv strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdestroy])
AC_CHECK_FUNCS(fdatasync,,
[AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
])
dnl mingw64 implements those as static inline, not functions with C linkage
AC_LINK_IFELSE([
AC_LANG_PROGRAM([#include <stdio.h>], [
char *c;
if (asprintf(&c, "%s %d", "string", 1) == -1)
c = NULL;
])],,[AC_LIBOBJ([asprintf])])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([#include <stdio.h>], [
char *c;
va_list ap;
if (vasprintf(&c, "%s %d", ap) == -1)
c = NULL;
])],,[AC_LIBOBJ([vasprintf])])
# Windows CE does not have strcoll()
AC_FUNC_STRCOLL
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment