From 2545db37fcfe35c5fb1c1e7ea003afd90d0db9fe Mon Sep 17 00:00:00 2001 From: smorlat Date: Mon, 12 Jan 2009 16:26:48 +0000 Subject: [PATCH] fix compilation problems when not having ssl. git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@233 3f6dc0c8-ddfe-455d-9043-3cd528dc4637 --- linphone/oRTP/configure.ac | 2 ++ linphone/oRTP/src/stun.c | 48 +++++++++++++++++++------------------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/linphone/oRTP/configure.ac b/linphone/oRTP/configure.ac index c3bc04427..bead7e062 100644 --- a/linphone/oRTP/configure.ac +++ b/linphone/oRTP/configure.ac @@ -233,6 +233,8 @@ if test $GCC = yes && test $wall_werror = yes; then CFLAGS="$CFLAGS -Werror " fi +AC_CHECK_HEADERS(openssl/hmac.h openssl/md5.h) + AC_CHECK_LIB(ssl,SSL_CTX_new,[SSL_LIBS="-lssl"]) AC_CHECK_LIB(crypto,MD5,[SSL_LIBS="$SSL_LIBS -lcrypto"]) diff --git a/linphone/oRTP/src/stun.c b/linphone/oRTP/src/stun.c index ccf83ee39..ec13c33fb 100644 --- a/linphone/oRTP/src/stun.c +++ b/linphone/oRTP/src/stun.c @@ -67,6 +67,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include "ortp-config.h" +#endif + #ifndef _WIN32_WCE #include #endif @@ -99,13 +103,9 @@ #endif -//#define NOSSL -/* - #if defined(__sparc__) || defined(WIN32) - #define NOSSL - #endif - #define NOSSL -*/ +#if !defined(HAVE_OPENSSL_HMAC_H) || !defined(HAVE_OPENSSL_MD5_H) +#define NOSSL 1 +#endif #include "ortp/stun_udp.h" #include "ortp/stun.h" @@ -326,23 +326,23 @@ turnParseAtrRequestedTransport( char* body, unsigned int hdrLen, TurnAtrRequest return TRUE; } -#ifdef ORTP_BIGENDIAN -#define htonq(n) n -#define ntohq(n) n -#else /* little endian */ -static inline UInt64 -htonq (UInt64 v) -{ - return htonl ((UInt32) (v >> 32)) - | (UInt64) htonl ((UInt32) v) << 32; -} -static inline UInt64 -ntohq (UInt64 v) -{ - return ntohl ((UInt32) (v >> 32)) - | (UInt64) ntohl ((UInt32) v) << 32; -} -#endif /* little endian */ +#ifdef ORTP_BIGENDIAN +#define htonq(n) n +#define ntohq(n) n +#else /* little endian */ +static inline UInt64 +htonq (UInt64 v) +{ + return htonl ((UInt32) (v >> 32)) + | (UInt64) htonl ((UInt32) v) << 32; +} +static inline UInt64 +ntohq (UInt64 v) +{ + return ntohl ((UInt32) (v >> 32)) + | (UInt64) ntohl ((UInt32) v) << 32; +} +#endif /* little endian */ static bool_t turnParseAtrReservationToken( char* body, unsigned int hdrLen, TurnAtrReservationToken *result )