From dcb493b1ea6f4b9869fccc920ac3e933f9c1aaca Mon Sep 17 00:00:00 2001
From: Michael Jerris <mike@jerris.com>
Date: Tue, 1 May 2007 23:09:06 +0000
Subject: [PATCH] fix msvc build.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5059 d0543943-73ff-0310-b7d9-9358b9ac24b2
---
 libs/libdingaling/src/sha1.c |  6 +++++-
 libs/libdingaling/src/sha1.h | 14 ++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/libs/libdingaling/src/sha1.c b/libs/libdingaling/src/sha1.c
index 513e4e0b7f..c54154a866 100644
--- a/libs/libdingaling/src/sha1.c
+++ b/libs/libdingaling/src/sha1.c
@@ -49,6 +49,10 @@
 # endif
 #endif
 
+#ifdef _MSC_VER
+#define inline __inline
+#endif
+
 #include <string.h>
 
 #include "sha1.h"
@@ -95,7 +99,7 @@ static const char rcsid[] =
 
 static inline uint64_t _byteswap64(uint64_t x)
 {
-  uint32_t a = x >> 32;
+  uint32_t a = (uint32_t)(x >> 32);
   uint32_t b = (uint32_t) x;
   return ((uint64_t) BYTESWAP(b) << 32) | (uint64_t) BYTESWAP(a);
 }
diff --git a/libs/libdingaling/src/sha1.h b/libs/libdingaling/src/sha1.h
index 7a6beb7f5d..ff489fa7b9 100644
--- a/libs/libdingaling/src/sha1.h
+++ b/libs/libdingaling/src/sha1.h
@@ -34,6 +34,20 @@
 #else
 # if HAVE_STDINT_H
 #  include <stdint.h>
+# else
+#  ifndef uint32_t
+#   ifdef WIN32
+typedef unsigned __int8		uint8_t;
+typedef unsigned __int16	uint16_t;
+typedef unsigned __int32	uint32_t;
+typedef unsigned __int64    uint64_t;
+typedef __int8		int8_t;
+typedef __int16		int16_t;
+typedef __int32		int32_t;
+typedef __int64		int64_t;
+typedef unsigned long	in_addr_t;
+#   endif
+#  endif
 # endif
 #endif