Land #496, add configure-time check for timespecsub
This commit is contained in:
commit
4eb8da3e07
@ -237,6 +237,11 @@ if(HAVE_GETPAGESIZE)
|
||||
add_definitions(-DHAVE_GETPAGESIZE)
|
||||
endif()
|
||||
|
||||
check_symbol_exists(timespecsub sys/time.h HAVE_TIMESPECSUB)
|
||||
if(HAVE_TIMESPECSUB)
|
||||
add_definitions(-DHAVE_TIMESPECSUB)
|
||||
endif()
|
||||
|
||||
check_function_exists(timingsafe_bcmp HAVE_TIMINGSAFE_BCMP)
|
||||
if(HAVE_TIMINGSAFE_BCMP)
|
||||
add_definitions(-DHAVE_TIMINGSAFE_BCMP)
|
||||
|
@ -39,7 +39,11 @@ typedef int clockid_t;
|
||||
int clock_gettime(clockid_t clock_id, struct timespec *tp);
|
||||
#endif
|
||||
|
||||
#ifndef timespecsub
|
||||
#ifdef timespecsub
|
||||
#define HAVE_TIMESPECSUB
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_TIMESPECSUB
|
||||
#define timespecsub(tsp, usp, vsp) \
|
||||
do { \
|
||||
(vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \
|
||||
@ -50,6 +54,7 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp);
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -5,7 +5,7 @@ AC_CHECK_HEADERS([err.h readpassphrase.h])
|
||||
AC_CHECK_FUNCS([asprintf freezero memmem])
|
||||
AC_CHECK_FUNCS([readpassphrase reallocarray recallocarray])
|
||||
AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strsep strtonum])
|
||||
AC_CHECK_FUNCS([timegm _mkgmtime])
|
||||
AC_CHECK_FUNCS([timegm _mkgmtime timespecsub])
|
||||
AC_CACHE_CHECK([for getpagesize], ac_cv_func_getpagesize, [
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
// Since Android NDK v16 getpagesize is defined as inline inside unistd.h
|
||||
|
Loading…
x
Reference in New Issue
Block a user