]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6010 --resolve
authorJeff Lenk <jeff@jefflenk.com>
Sat, 30 Nov 2013 04:16:49 +0000 (22:16 -0600)
committerJeff Lenk <jeff@jefflenk.com>
Sat, 30 Nov 2013 04:16:49 +0000 (22:16 -0600)
libs/apr/atomic/win32/apr_atomic.c
libs/esl/src/esl_event.c
libs/ilbc/src/iLBC_decode.c
libs/libsndfile/src/float_cast.h
libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c
libs/sofia-sip/libsofia-sip-ua/su/strtoull.c
libs/sofia-sip/libsofia-sip-ua/su/su_taglist.c
libs/spandsp/src/msvc/config.h
libs/spandsp/src/spandsp/fast_convert.h
src/switch_time.c

index 9393fcb0088d001971e4c88b8329e19a068e9ee7..18a7bcd0ba30ba460a915fd848229ae4b940ef28 100644 (file)
@@ -27,6 +27,7 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p)
  * Remapping function pointer type to accept apr_uint32_t's type-safely
  * as the arguments for as our apr_atomic_foo32 Functions
  */
+#if (_MSC_VER < 1800)
 typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_fn)
     (apr_uint32_t volatile *);
 typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_fn)
@@ -38,11 +39,14 @@ typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_val_fn)
 typedef WINBASEAPI void * (WINAPI * apr_atomic_win32_ptr_ptr_ptr_fn)
     (volatile void **, 
      void *, const void *);
+#endif
 
 APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val)
 {
 #if (defined(_M_IA64) || defined(_M_AMD64))
     return InterlockedExchangeAdd(mem, val);
+#elif (_MSC_VER >= 1800)
+       return InterlockedExchangeAdd(mem, val);
 #else
     return ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val);
 #endif
@@ -55,6 +59,8 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val)
 {
 #if (defined(_M_IA64) || defined(_M_AMD64))
     InterlockedExchangeAdd(mem, -val);
+#elif (_MSC_VER >= 1800)
+       InterlockedExchangeAdd(mem, -val);
 #else
     ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, -val);
 #endif
@@ -65,6 +71,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem)
     /* we return old value, win32 returns new value :( */
 #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED)
     return InterlockedIncrement(mem) - 1;
+#elif (_MSC_VER >= 1800)
+       return InterlockedIncrement(mem) - 1;
 #else
     return ((apr_atomic_win32_ptr_fn)InterlockedIncrement)(mem) - 1;
 #endif
@@ -74,6 +82,8 @@ APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem)
 {
 #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED)
     return InterlockedDecrement(mem);
+#elif (_MSC_VER >= 1800)
+       return InterlockedDecrement(mem);
 #else
     return ((apr_atomic_win32_ptr_fn)InterlockedDecrement)(mem);
 #endif
@@ -83,6 +93,8 @@ APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val)
 {
 #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED)
     InterlockedExchange(mem, val);
+#elif (_MSC_VER >= 1800)
+       InterlockedExchange(mem, val);
 #else
     ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val);
 #endif
@@ -98,6 +110,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint3
 {
 #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED)
     return InterlockedCompareExchange(mem, with, cmp);
+#elif (_MSC_VER >= 1800)
+       return InterlockedCompareExchange(mem, with, cmp);
 #else
     return ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem, with, cmp);
 #endif
@@ -107,6 +121,8 @@ APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const voi
 {
 #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED)
     return InterlockedCompareExchangePointer(mem, with, cmp);
+#elif (_MSC_VER >= 1800)
+       return InterlockedCompareExchangePointer(mem, with, cmp);
 #else
     /* Too many VC6 users have stale win32 API files, stub this */
     return ((apr_atomic_win32_ptr_ptr_ptr_fn)InterlockedCompareExchange)(mem, with, cmp);
@@ -117,6 +133,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint
 {
 #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED)
     return InterlockedExchange(mem, val);
+#elif (_MSC_VER >= 1800)
+       return InterlockedExchange(mem, val);
 #else
     return ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val);
 #endif
index b5a6be4d58f7feafd4a49eecb72c2e3bb28a2d08..41f4f9f0acf802b54dd914bdf10bda31c740ae79 100644 (file)
@@ -308,7 +308,7 @@ ESL_DECLARE(esl_status_t) esl_event_del_header_val(esl_event_t *event, const cha
                esl_assert(x < 1000000);
                hash = esl_ci_hashfunc_default(header_name, &hlen);
 
-               if ((!hp->hash || hash == hp->hash) && (hp->name && !strcasecmp(header_name, hp->name)) && (esl_strlen_zero(val) || !strcmp(hp->value, val))) {
+               if ((!hp->hash || hash == hp->hash) && (hp->name && !strcasecmp(header_name, hp->name)) && (esl_strlen_zero(val) || (hp->value && !strcmp(hp->value, val)))) {
                        if (lp) {
                                lp->next = hp->next;
                        } else {
index 9fc7a24bb4871e53f3efa7f4adf0c6e38da29c6f..ddc164bed852ca543fec216debb297c6b40bd871 100644 (file)
@@ -40,6 +40,7 @@
 #include "hpOutput.h"
 #include "syntFilter.h"
 
+#if (defined(WIN32) || defined(_WIN32)) && (_MSC_VER < 1800)
 #if (defined(WIN32)  ||  defined(_WIN32)) && !defined(_WIN64)
     __inline long int rint(double dbl)
     {
@@ -63,6 +64,7 @@
 #endif
     }
 #endif
+#endif
 
 /*----------------------------------------------------------------*
  *  Initiation of decoder instance.
index 2c06aaf23379c4fb811b3b0885e7102bc9d89479..98c7de74b18f8ba8f8babeb2870d74d695717ea8 100644 (file)
        }
 
 #elif defined(_WIN64)
+#if (_MSC_VER < 1800)
     __inline long int lrint(double x)
     {
         return (long int) (x);
     {
         return (long int) (x);
     }
+#endif
 #elif (defined (__MWERKS__) && defined (macintosh))
 
        /* This MacOS 9 solution was provided by Stephane Letz */
index 7877100978e5cc626bc6cf4efdd831505c65fd7b..f29d7139bb4e065b8d1bd9c198166980be05bdf4 100644 (file)
@@ -1808,8 +1808,10 @@ static int parse_ul(sdp_parser_t *p, char **r,
 }
 
 #if !HAVE_STRTOULL
+#if !((defined(WIN32) || defined(_WIN32)) && (_MSC_VER >= 1800))
 unsigned long long strtoull(char const *string, char **return_end, int base);
 #endif
+#endif
 
 /*
  * parse_ull: parse an unsigned long long
index c4854aaeac1f02fd1b38d9bb898499bacdb8adbd..824a39df437fafb0255e223b29db07d958068604 100644 (file)
@@ -73,7 +73,10 @@ static char cvtIn[] = {
     20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
     30, 31, 32, 33, 34, 35};
 
-\f
+
+
+#if !((defined(WIN32) || defined(_WIN32)) && (_MSC_VER >= 1800))
+
 /**Convert an ASCII string into an unsigned long long integer.
  *
  * @param[in]  string  String of ASCII digits, possibly preceded by white
@@ -284,3 +287,5 @@ strtoull(const char *string, char **endPtr, int base)
 
     return (unsigned longlong)-1;
 }
+
+#endif
index 65037c2d185b50789fbd516fc61c0e4890683439..431a2dcb5655af7020a0f6f41e7d9c02fbd31362 100644 (file)
 #include <sofia-sip/su_string.h>
 
 #ifndef HAVE_STRTOULL
+#if !((defined(WIN32) || defined(_WIN32)) && (_MSC_VER >= 1800))
 unsigned longlong strtoull(const char *, char **, int);
 #endif
+#endif
 
 /**@defgroup su_tag Tag Item Lists
  *
index 876f66f56aaaf72a33eea6bfeefc339438232de9..c974d7c7c4a9f8b77bc260272823aca491ed5614 100644 (file)
@@ -74,7 +74,9 @@
 
   #define _MMX_H_
 
+  #if !((defined(WIN32) || defined(_WIN32)) && (_MSC_VER >= 1800))
   #define cbrtf(value) pow((float)value, (float).333)
+  #endif
 
   #include <malloc.h> // To get alloca
 
index e6da451f9c58387134c05ec6af6a32bfd12fd5b3..120050646fc131d7d6a53e5f6bd5e14f26b4a34f 100644 (file)
@@ -247,6 +247,7 @@ extern "C"
      *    Therefore implement inline versions of these functions here.
      */
 
+#if (_MSC_VER < 1800)
     __inline long int lrint(double x)
     {
         long int i;
@@ -288,6 +289,7 @@ extern "C"
             frndint
         }
     }
+#endif
 
     __inline long int lfastrint(double x)
     {
@@ -317,6 +319,7 @@ extern "C"
     /* x86_64 machines will do best with a simple assignment. */
 #include <intrin.h>
 
+#if (_MSC_VER < 1800)
     __inline long int lrint(double x)
     {
         return (long int)_mm_cvtsd_si64x( _mm_loadu_pd ((const double*)&x) );
@@ -326,6 +329,7 @@ extern "C"
     {
         return _mm_cvt_ss2si( _mm_load_ss((const float*)&x) );
     }
+#endif
 
     __inline long int lfastrint(double x)
     {
index c4b6b8b4456dc5d99af245987dfa8f822eafc261..63152aac311c6da45ffac38299abb1397c6eb536 100644 (file)
@@ -756,7 +756,7 @@ static switch_status_t timer_step(switch_timer_t *timer)
        }
 
        check_roll();
-       samples = timer->samples * (private_info->reference - private_info->start);
+       samples = (uint64_t)timer->samples * (private_info->reference - private_info->start);
 
        if (samples > UINT32_MAX) {
                private_info->start = private_info->reference - 1; /* Must have a diff */