build: Check for ntohll().
This function is available on AIX.
Этот коммит содержится в:
родитель
3fa801a929
Коммит
640e3830f2
@ -119,6 +119,7 @@ if (UNIX)
|
|||||||
check_function_exists(poll HAVE_POLL)
|
check_function_exists(poll HAVE_POLL)
|
||||||
check_function_exists(select HAVE_SELECT)
|
check_function_exists(select HAVE_SELECT)
|
||||||
check_function_exists(cfmakeraw HAVE_CFMAKERAW)
|
check_function_exists(cfmakeraw HAVE_CFMAKERAW)
|
||||||
|
check_function_exists(ntohll HAVE_NTOHLL)
|
||||||
endif (UNIX)
|
endif (UNIX)
|
||||||
|
|
||||||
set(LIBSSH_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CACHE INTERNAL "libssh required system libraries")
|
set(LIBSSH_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CACHE INTERNAL "libssh required system libraries")
|
||||||
|
@ -77,6 +77,9 @@
|
|||||||
/* Define to 1 if you have the `clock_gettime' function. */
|
/* Define to 1 if you have the `clock_gettime' function. */
|
||||||
#cmakedefine HAVE_CLOCK_GETTIME 1
|
#cmakedefine HAVE_CLOCK_GETTIME 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `ntohll' function. */
|
||||||
|
#cmakedefine HAVE_NTOHLL 1
|
||||||
|
|
||||||
/*************************** LIBRARIES ***************************/
|
/*************************** LIBRARIES ***************************/
|
||||||
|
|
||||||
/* Define to 1 if you have the `crypto' library (-lcrypto). */
|
/* Define to 1 if you have the `crypto' library (-lcrypto). */
|
||||||
|
@ -286,18 +286,20 @@ int ssh_is_ipaddr(const char *str) {
|
|||||||
|
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
|
#ifndef HAVE_NTOHLL
|
||||||
uint64_t ntohll(uint64_t a) {
|
uint64_t ntohll(uint64_t a) {
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
return a;
|
return a;
|
||||||
#else
|
#else /* WORDS_BIGENDIAN */
|
||||||
uint32_t low = (uint32_t)(a & 0xffffffff);
|
uint32_t low = (uint32_t)(a & 0xffffffff);
|
||||||
uint32_t high = (uint32_t)(a >> 32);
|
uint32_t high = (uint32_t)(a >> 32);
|
||||||
low = ntohl(low);
|
low = ntohl(low);
|
||||||
high = ntohl(high);
|
high = ntohl(high);
|
||||||
|
|
||||||
return ((((uint64_t) low) << 32) | ( high));
|
return ((((uint64_t) low) << 32) | ( high));
|
||||||
#endif
|
#endif /* WORDS_BIGENDIAN */
|
||||||
}
|
}
|
||||||
|
#endif /* HAVE_NTOHLL */
|
||||||
|
|
||||||
char *ssh_lowercase(const char* str) {
|
char *ssh_lowercase(const char* str) {
|
||||||
char *new, *p;
|
char *new, *p;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user