1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-31 00:03:07 +03:00

cmake: Correctly check for sys/[u]time.h

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2016-11-06 11:52:12 +01:00
parent fab85b495e
commit 528b9c5323
7 changed files with 17 additions and 12 deletions

View File

@ -59,6 +59,7 @@ check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(util.h HAVE_UTIL_H) check_include_file(util.h HAVE_UTIL_H)
check_include_file(libutil.h HAVE_LIBUTIL_H) check_include_file(libutil.h HAVE_LIBUTIL_H)
check_include_file(sys/time.h HAVE_SYS_TIME_H) check_include_file(sys/time.h HAVE_SYS_TIME_H)
check_include_file(sys/utime.h HAVE_SYS_UTIME_H)
check_include_file(sys/param.h HAVE_SYS_PARAM_H) check_include_file(sys/param.h HAVE_SYS_PARAM_H)
check_include_file(arpa/inet.h HAVE_ARPA_INET_H) check_include_file(arpa/inet.h HAVE_ARPA_INET_H)
check_include_file(byteswap.h HAVE_BYTESWAP_H) check_include_file(byteswap.h HAVE_BYTESWAP_H)

View File

@ -35,6 +35,9 @@
/* Define to 1 if you have the <sys/time.h> header file. */ /* Define to 1 if you have the <sys/time.h> header file. */
#cmakedefine HAVE_SYS_TIME_H 1 #cmakedefine HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/utime.h> header file. */
#cmakedefine HAVE_SYS_UTIME_H 1
/* Define to 1 if you have the <termios.h> header file. */ /* Define to 1 if you have the <termios.h> header file. */
#cmakedefine HAVE_TERMIOS_H 1 #cmakedefine HAVE_TERMIOS_H 1

View File

@ -185,10 +185,6 @@ int gettimeofday(struct timeval *__p, void *__t);
# define LIBSSH_MEM_PROTECTION # define LIBSSH_MEM_PROTECTION
#endif #endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
/* forward declarations */ /* forward declarations */
struct ssh_common_struct; struct ssh_common_struct;
struct ssh_kex_struct; struct ssh_kex_struct;

View File

@ -24,11 +24,12 @@
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#ifndef _WIN32 #ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#else #endif /* HAVE_SYS_TIME_H */
#ifdef HAVE_SYS_UTIME_H
#include <sys/utime.h> #include <sys/utime.h>
#endif #endif /* HAVE_SYS_TIME_H */
#include <time.h> #include <time.h>
#include "libssh/priv.h" #include "libssh/priv.h"

View File

@ -33,10 +33,6 @@
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif /* HAVE_SYS_TIME_H */
#endif /* _WIN32 */ #endif /* _WIN32 */
#include <limits.h> #include <limits.h>
@ -47,6 +43,10 @@
#include <sys/types.h> #include <sys/types.h>
#include <ctype.h> #include <ctype.h>
#include <time.h> #include <time.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif /* HAVE_SYS_TIME_H */
#ifdef _WIN32 #ifdef _WIN32

View File

@ -29,9 +29,11 @@
#include <ws2tcpip.h> #include <ws2tcpip.h>
#else #else
#include <netinet/in.h> #include <netinet/in.h>
#include <sys/time.h>
#include <sys/socket.h> #include <sys/socket.h>
#endif #endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif /* HAVE_SYS_TIME_H */
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -23,7 +23,9 @@
#include "torture.h" #include "torture.h"
#include <libssh/libssh.h> #include <libssh/libssh.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif /* HAVE_SYS_TIME_H */
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <sys/types.h> #include <sys/types.h>