mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 01:18:00 +00:00
Fix build failure on Intel Macs.
sysctlbyname() turns out to be a new library function, so we can't assume it's present just because defined __APPLE__. Add an autoconf check to see if it's really there, before trying to call it.
This commit is contained in:
parent
31cd5ee19b
commit
d594df9803
@ -169,7 +169,7 @@ AC_CHECK_LIB(X11, XOpenDisplay,
|
|||||||
[GTK_LIBS="-lX11 $GTK_LIBS"
|
[GTK_LIBS="-lX11 $GTK_LIBS"
|
||||||
AC_DEFINE([HAVE_LIBX11],[],[Define if libX11.a is available])])
|
AC_DEFINE([HAVE_LIBX11],[],[Define if libX11.a is available])])
|
||||||
|
|
||||||
AC_CHECK_FUNCS([getaddrinfo posix_openpt ptsname setresuid strsignal updwtmpx fstatat dirfd futimes setpwent endpwent getauxval elf_aux_info])
|
AC_CHECK_FUNCS([getaddrinfo posix_openpt ptsname setresuid strsignal updwtmpx fstatat dirfd futimes setpwent endpwent getauxval elf_aux_info sysctlbyname])
|
||||||
AC_CHECK_DECLS([CLOCK_MONOTONIC], [], [], [[#include <time.h>]])
|
AC_CHECK_DECLS([CLOCK_MONOTONIC], [], [], [[#include <time.h>]])
|
||||||
AC_CHECK_HEADERS([sys/auxv.h asm/hwcap.h sys/sysctl.h sys/types.h glob.h])
|
AC_CHECK_HEADERS([sys/auxv.h asm/hwcap.h sys/sysctl.h sys/types.h glob.h])
|
||||||
AC_SEARCH_LIBS([clock_gettime], [rt], [AC_DEFINE([HAVE_CLOCK_GETTIME],[],[Define if clock_gettime() is available])])
|
AC_SEARCH_LIBS([clock_gettime], [rt], [AC_DEFINE([HAVE_CLOCK_GETTIME],[],[Define if clock_gettime() is available])])
|
||||||
|
@ -49,10 +49,14 @@ static inline u_long getauxval(int which) { return 0; }
|
|||||||
#if defined __APPLE__
|
#if defined __APPLE__
|
||||||
static inline bool test_sysctl_flag(const char *flagname)
|
static inline bool test_sysctl_flag(const char *flagname)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_SYSCTLBYNAME
|
||||||
int value;
|
int value;
|
||||||
size_t size = sizeof(value);
|
size_t size = sizeof(value);
|
||||||
return (sysctlbyname(flagname, &value, &size, NULL, 0) == 0 &&
|
return (sysctlbyname(flagname, &value, &size, NULL, 0) == 0 &&
|
||||||
size == sizeof(value) && value != 0);
|
size == sizeof(value) && value != 0);
|
||||||
|
#else /* HAVE_SYSCTLBYNAME */
|
||||||
|
return false;
|
||||||
|
#endif /* HAVE_SYSCTLBYNAME */
|
||||||
}
|
}
|
||||||
#endif /* defined __APPLE__ */
|
#endif /* defined __APPLE__ */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user