check for timegm()
This commit is contained in:
@@ -71,6 +71,7 @@ set(CMAKE_REQUIRED_LIBRARIES pthread rt)
|
|||||||
check_function_exists(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
|
check_function_exists(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
|
||||||
check_function_exists(pselect HAVE_PSELECT)
|
check_function_exists(pselect HAVE_PSELECT)
|
||||||
check_function_exists(ppoll HAVE_PPOLL)
|
check_function_exists(ppoll HAVE_PPOLL)
|
||||||
|
check_function_exists(timegm HAVE_TIMEGM)
|
||||||
check_include_file(linux/serial.h HAVE_LINUX_SERIAL -DHAVE_LINUX_SERIAL=1)
|
check_include_file(linux/serial.h HAVE_LINUX_SERIAL -DHAVE_LINUX_SERIAL=1)
|
||||||
check_include_file(dev/usb/uftdiio.h HAVE_FREEBSD_UFTDI -DHAVE_FREEBSD_UFTDI=1)
|
check_include_file(dev/usb/uftdiio.h HAVE_FREEBSD_UFTDI -DHAVE_FREEBSD_UFTDI=1)
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,9 @@
|
|||||||
/* Defined if time.h is available. */
|
/* Defined if time.h is available. */
|
||||||
#cmakedefine HAVE_TIME_H
|
#cmakedefine HAVE_TIME_H
|
||||||
|
|
||||||
|
/* Defined if timegm() is available. */
|
||||||
|
#cmakedefine HAVE_TIMEGM
|
||||||
|
|
||||||
/* Defined if syslog.h is available. */
|
/* Defined if syslog.h is available. */
|
||||||
#cmakedefine HAVE_SYSLOG_H
|
#cmakedefine HAVE_SYSLOG_H
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ AC_CHECK_HEADERS([arpa/inet.h \
|
|||||||
time.h \
|
time.h \
|
||||||
termios.h])
|
termios.h])
|
||||||
|
|
||||||
|
AC_CHECK_FUNC([timegm], [AC_DEFINE(HAVE_TIMEGM, [1], [Defined if timegm() is available.])])
|
||||||
AC_CHECK_FUNC([cfsetspeed], [AC_DEFINE(HAVE_CFSETSPEED, [1], [Defined if cfsetspeed() is available.])])
|
AC_CHECK_FUNC([cfsetspeed], [AC_DEFINE(HAVE_CFSETSPEED, [1], [Defined if cfsetspeed() is available.])])
|
||||||
|
|
||||||
AC_CHECK_LIB([pthread], [pthread_setname_np],
|
AC_CHECK_LIB([pthread], [pthread_setname_np],
|
||||||
|
|||||||
@@ -506,7 +506,7 @@ bool* repeatable, time_t* time) {
|
|||||||
string headers = result.substr(0, pos+2); // including final \r\n
|
string headers = result.substr(0, pos+2); // including final \r\n
|
||||||
const char* hdrs = headers.c_str();
|
const char* hdrs = headers.c_str();
|
||||||
*response = result.substr(pos+4);
|
*response = result.substr(pos+4);
|
||||||
#ifdef HAVE_TIME_H
|
#if defined(HAVE_TIME_H) && defined(HAVE_TIMEGM)
|
||||||
if (time) {
|
if (time) {
|
||||||
pos = headers.find("\r\nLast-Modified: ");
|
pos = headers.find("\r\nLast-Modified: ");
|
||||||
if (pos != string::npos && headers.substr(pos+42, 4) == " GMT") {
|
if (pos != string::npos && headers.substr(pos+42, 4) == " GMT") {
|
||||||
|
|||||||
Reference in New Issue
Block a user