jq/jq-configure-c99-2.patch

19 lines
1023 B
Diff

The gettimeofday function is declared in <sys/time.h>, not <time.h>,
according to POSIX and actual systems.
Submitted upstream: <https://github.com/stedolan/jq/pull/2519>
diff --git a/configure.ac b/configure.ac
index ccd494ad7c365839..c3edaa32756b807c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,7 +135,7 @@ AC_FIND_FUNC([gmtime_r], [c], [#include <time.h>], [0, 0])
AC_FIND_FUNC([gmtime], [c], [#include <time.h>], [0])
AC_FIND_FUNC([localtime_r], [c], [#include <time.h>], [0, 0])
AC_FIND_FUNC([localtime], [c], [#include <time.h>], [0])
-AC_FIND_FUNC([gettimeofday], [c], [#include <time.h>], [0, 0])
+AC_FIND_FUNC([gettimeofday], [c], [#include <sys/time.h>], [0, 0])
AC_CHECK_MEMBER([struct tm.tm_gmtoff], [AC_DEFINE([HAVE_TM_TM_GMT_OFF],1,[Define to 1 if the system has the tm_gmt_off field in struct tm])],
[], [[#include <time.h>]])
AC_CHECK_MEMBER([struct tm.__tm_gmtoff], [AC_DEFINE([HAVE_TM___TM_GMT_OFF],1,[Define to 1 if the system has the __tm_gmt_off field in struct tm])],