]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7967 SmartOS compatibility
authorStanislav Sinyagin <ssinyagin@k-open.com>
Wed, 9 Sep 2015 21:23:18 +0000 (21:23 +0000)
committerStanislav Sinyagin <ssinyagin@k-open.com>
Wed, 9 Sep 2015 21:39:41 +0000 (21:39 +0000)
configure.ac: honor NetBSD and SmartOS in search for system lua
src/switch_utf8.c: remove switch_u8_vprintf and switch_u8_printf
replace u_int32_t with C99 standard uint32_t, and also the same for
  8,16,64 bit

configure.ac
libs/spandsp/tests/pcap_parse.c
src/include/switch_utf8.h
src/mod/applications/mod_mp4/mod_mp4.cpp
src/mod/applications/mod_mp4/mp4_helper.cpp
src/mod/applications/mod_mp4/mp4_helper.hpp
src/mod/endpoints/mod_skypopen/old-stuff/pcm_lib.c
src/mod/endpoints/mod_skypopen/old-stuff/pcm_native.c
src/switch_utf8.c

index 77b4135b8289f1e8f9ca3db7ed6cfdf3cf98b28f..becdd41f2c4920b2c13a9a510137497ef7e64bb8 100644 (file)
@@ -559,13 +559,12 @@ AC_SUBST(SYS_XMLRPC_CFLAGS)
 AC_SUBST(SYS_XMLRPC_LDFLAGS)
 AM_CONDITIONAL([SYSTEM_XMLRPCC],[test "${enable_xmlrpcc}" = "yes"])
 
-PKG_CHECK_MODULES([LUA],[lua5.2],[have_lua=yes],[have_lua=no])
-if test "${have_lua}" = "no" ; then
-   PKG_CHECK_MODULES([LUA],[lua5.1],[have_lua=yes],[have_lua=no])
-fi
-if test "${have_lua}" = "no" ; then
-   PKG_CHECK_MODULES([LUA],[lua],[have_lua=yes],[have_lua=no])
-fi
+for luaversion in lua5.2 lua-5.2 lua5.1 lua-5.1 lua; do
+  PKG_CHECK_MODULES([LUA],[${luaversion}],[have_lua=yes],[have_lua=no])
+  if test ${have_lua} = yes; then
+    break
+  fi
+done
 if test x"${LUA_LIBS}" = x"" ; then
    LUA_LIBS="-llua"
 fi
index bc3805af2affccbf7e54a7a941145bf32a7d0873..56d8d288e81c42fa8d0c28a42d37fb7ccce0ab40 100644 (file)
@@ -113,7 +113,7 @@ typedef struct _null_hdr
 typedef struct _ipv6_hdr
 {
     char dontcare[6];
-    u_int8_t nxt_header; /* we only need the next header, so we can determine, if the next header is UDP or not */
+    uint8_t nxt_header; /* we only need the next header, so we can determine, if the next header is UDP or not */
     char dontcare2[33];
 } ipv6_hdr;
 #endif
index 2089370b498852a3b54d72a4a482a0767639c63e..11699843ee62dd52bef209b9f12b15e91a84c9b2 100644 (file)
@@ -110,10 +110,4 @@ SWITCH_DECLARE(int) switch_u8_strlen(char *s);
 
 SWITCH_DECLARE(int) switch_u8_is_locale_utf8(char *locale);
 
-/* printf where the format string and arguments may be in UTF-8.
-   you can avoid this function and just use ordinary printf() if the current
-   locale is UTF-8. */
-SWITCH_DECLARE(int) switch_u8_vprintf(char *fmt, va_list ap);
-SWITCH_DECLARE(int) switch_u8_printf(char *fmt, ...);
-
 SWITCH_DECLARE(uint32_t) switch_u8_get_char(char *s, int *i);
index 6617b8be29f329dee08400514c1f9e1791af5cff..64d6c728b39d5d9f36312722ce2fb69a8dc28442 100644 (file)
@@ -266,7 +266,7 @@ static void *SWITCH_THREAD_FUNC play_video_function(switch_thread_t *thread, voi
 {
        AVParams * pt = reinterpret_cast<AVParams*>(obj);
        u_int next = 0, first = 0xffffffff;
-       u_int64_t ts = 0, control = 0;
+       uint64_t ts = 0, control = 0;
 
        bool ok;
        bool sent = true;
@@ -323,7 +323,7 @@ static void *SWITCH_THREAD_FUNC play_audio_function(switch_thread_t *thread, voi
 {
        AVParams * pt = reinterpret_cast<AVParams*>(obj);
        u_int next = 0, first = 0xffffffff;
-       u_int64_t ts = 0, control = 0;
+       uint64_t ts = 0, control = 0;
 
        bool ok;
        bool sent = true;
index c560cddb7de6ee79bdd687407b2e98bfd6489248..ae6ee81da1cb9023db504c573140679e2250c412 100644 (file)
@@ -129,7 +129,7 @@ namespace MP4
                }
 
                ts = rt.last_frame;
-               if (!MP4ReadRtpPacket(fh, hint, rt.packet, (u_int8_t **) &buffer, &size, 0, header, true)) return false;
+               if (!MP4ReadRtpPacket(fh, hint, rt.packet, (uint8_t **) &buffer, &size, 0, header, true)) return false;
                ++rt.packet;
                return true;
        }
index 6b41fd5dedf65b53e0c7b42758776b5e69a0582b..8f61cd6c6b542ea450f48cb55284e78fee41cfb5 100644 (file)
@@ -56,10 +56,10 @@ namespace MP4
        };
        
        struct RuntimeProperties {
-               u_int32_t frame; // sampleID
-               u_int16_t packetsPerFrame;
-               u_int16_t packet; // packetID
-               u_int32_t last_frame; // timestamp
+               uint32_t frame; // sampleID
+               uint16_t packetsPerFrame;
+               uint16_t packet; // packetID
+               uint32_t last_frame; // timestamp
 
                RuntimeProperties(): frame(0), packetsPerFrame(0), packet(0)
                {
@@ -72,9 +72,9 @@ namespace MP4
                MP4TrackId track;
 
                char * codecName;
-               u_int8_t payload;
-               u_int32_t clock;
-               u_int32_t packetLength; // packet Length in time (ms)
+               uint8_t payload;
+               uint32_t clock;
+               uint32_t packetLength; // packet Length in time (ms)
                
                RuntimeProperties runtime;
 
index 597a3a6c9e276460dd57046a7b87057363a95753..6fb88079d5065535ab7f839090b14493fa4cf6a7 100644 (file)
@@ -540,7 +540,7 @@ static inline unsigned int mul(unsigned int a, unsigned int b)
 static inline unsigned int muldiv32(unsigned int a, unsigned int b,
                                    unsigned int c, unsigned int *r)
 {
-       u_int64_t n = (u_int64_t) a * b;
+       uint64_t n = (u_int64_t) a * b;
        if (c == 0) {
                snd_BUG_ON(!n);
                *r = 0;
@@ -1094,7 +1094,7 @@ EXPORT_SYMBOL(snd_pcm_hw_rule_add);
  * Apply the constraint of the given bitmap mask to a 32-bit mask parameter.
  */
 int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
-                              u_int32_t mask)
+                              uint32_t mask)
 {
        struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints;
        struct snd_mask *maskp = constrs_mask(constrs, var);
@@ -1114,12 +1114,12 @@ int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime, snd_pcm_hw_param
  * Apply the constraint of the given bitmap mask to a 64-bit mask parameter.
  */
 int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
-                                u_int64_t mask)
+                                uint64_t mask)
 {
        struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints;
        struct snd_mask *maskp = constrs_mask(constrs, var);
-       maskp->bits[0] &= (u_int32_t)mask;
-       maskp->bits[1] &= (u_int32_t)(mask >> 32);
+       maskp->bits[0] &= (uint32_t)mask;
+       maskp->bits[1] &= (uint32_t)(mask >> 32);
        memset(maskp->bits + 2, 0, (SNDRV_MASK_MAX-64) / 8); /* clear rest */
        if (! maskp->bits[0] && ! maskp->bits[1])
                return -EINVAL;
index fe9d42ed4218197a5c1981fe5ccd9e34c2a794f6..0b6a7fd20a16315bbc7037af59b19e29f3a207db 100644 (file)
@@ -369,16 +369,16 @@ static int period_to_usecs(struct snd_pcm_runtime *runtime)
 
 static int calc_boundary(struct snd_pcm_runtime *runtime)
 {
-       u_int64_t boundary;
+       uint64_t boundary;
 
-       boundary = (u_int64_t)runtime->buffer_size *
-                  (u_int64_t)runtime->period_size;
+       boundary = (uint64_t)runtime->buffer_size *
+                  (uint64_t)runtime->period_size;
 #if BITS_PER_LONG < 64
        /* try to find lowest common multiple for buffer and period */
        if (boundary > LONG_MAX - runtime->buffer_size) {
-               u_int32_t remainder = -1;
-               u_int32_t divident = runtime->buffer_size;
-               u_int32_t divisor = runtime->period_size;
+               uint32_t remainder = -1;
+               uint32_t divident = runtime->buffer_size;
+               uint32_t divisor = runtime->period_size;
                while (remainder) {
                        remainder = divident % divisor;
                        if (remainder) {
index eaa59a5c9df2128d01fa9ef8739b82b18b7dcd94..86c7f5e4a9c6d8d8cfd577c8e3468497fe1b6fc9 100644 (file)
@@ -463,45 +463,12 @@ SWITCH_DECLARE(int) switch_u8_is_locale_utf8(char *locale)
     return 0;
 }
 
-SWITCH_DECLARE(int) switch_u8_vprintf(char *fmt, va_list ap)
-{
-    int cnt, sz=0;
-    char *buf;
-    uint32_t *wcs;
-
-    sz = 512;
-    buf = (char*)alloca(sz);
- try_print:
-    cnt = vsnprintf(buf, sz, fmt, ap);
-    if (cnt >= sz) {
-        buf = (char*)alloca(cnt - sz + 1);
-        sz = cnt + 1;
-        goto try_print;
-    }
-    wcs = (uint32_t*)alloca((cnt+1) * sizeof(uint32_t));
-    cnt = switch_u8_toucs(wcs, cnt+1, buf, cnt);
-    printf("%ls", (wchar_t*)wcs);
-    return cnt;
-}
-
-SWITCH_DECLARE(int) switch_u8_printf(char *fmt, ...)
-{
-    int cnt;
-    va_list args;
-
-    va_start(args, fmt);
-
-    cnt = switch_u8_vprintf(fmt, args);
-
-    va_end(args);
-    return cnt;
-}
 
 
 /* reads the next utf-8 sequence out of a string, updating an index */
 SWITCH_DECLARE(uint32_t) switch_u8_get_char(char *s, int *i)
 {
-       u_int32_t ch = 0;
+       uint32_t ch = 0;
        int sz = 0;
 
        do {