Mercurial > vim
changeset 23019:29b2448f2191 v8.2.2056
patch 8.2.2056: configure fails when building with implicit-function-declaration
Commit: https://github.com/vim/vim/commit/ce7be3a0e6f19bc85990bb8fcfe5e208944777b4
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 26 20:11:11 2020 +0100
patch 8.2.2056: configure fails when building with implicit-function-declaration
Problem: Configure fails when building with the
"implicit-function-declaration" error enabled, specifically on Mac.
Solution: Declear the functions like in the source code. (suggestion by
Clemens Lang, closes #7380)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 26 Nov 2020 20:15:04 +0100 |
parents | 4007526cb1ed |
children | 61decb85346b |
files | src/auto/configure src/configure.ac src/version.c |
diffstat | 3 files changed, 23 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/auto/configure +++ b/src/auto/configure @@ -12350,10 +12350,18 @@ if test -c /dev/ptmx ; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int -main () -{ -ptsname(0);grantpt(0);unlockpt(0); +// These should be in stdlib.h, but it depends on _XOPEN_SOURCE. +char *ptsname(int); +int unlockpt(int); +int grantpt(int); + +int +main () +{ + + ptsname(0); + grantpt(0); + unlockpt(0); ; return 0; }
--- a/src/configure.ac +++ b/src/configure.ac @@ -3593,7 +3593,15 @@ fi AC_MSG_CHECKING(for SVR4 ptys) if test -c /dev/ptmx ; then - AC_TRY_LINK([], [ptsname(0);grantpt(0);unlockpt(0);], + AC_TRY_LINK([ +// These should be in stdlib.h, but it depends on _XOPEN_SOURCE. +char *ptsname(int); +int unlockpt(int); +int grantpt(int); + ], [ + ptsname(0); + grantpt(0); + unlockpt(0);], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SVR4_PTYS), AC_MSG_RESULT(no)) else