]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6294 FS-6308 NetBSD support should work test and report back please.
authorBrian West <brian@freeswitch.org>
Wed, 19 Mar 2014 19:34:02 +0000 (14:34 -0500)
committerBrian West <brian@freeswitch.org>
Wed, 19 Mar 2014 19:34:07 +0000 (14:34 -0500)
libs/apr/configure.ac
libs/esl/src/esl_json.c
libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/sip/sip_tag_class.c
libs/sofia-sip/libsofia-sip-ua/su/su_bm.c
libs/sofia-sip/libsofia-sip-ua/su/su_kqueue_port.c
src/include/switch_utils.h
src/switch_json.c

index 354fa772ba99923ae9f9247ac892118ee62cd08f..fa5796eccac7dd1bb9224b7e301be2ccf3997b8b 100644 (file)
@@ -1375,6 +1375,9 @@ case $host in
    *-solaris*)
        pid_t_fmt='#define APR_PID_T_FMT "ld"'
        ;;
+   *-netbsd*)
+       pid_t_fmt='#define APR_PID_T_FMT "ld"'
+       ;;
    *aix4*|*aix5*)
        ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"'
        size_t_fmt='#define APR_SIZE_T_FMT "ld"'
index 41f9936ff7474e0d2edf81c72230e8ef055c3f42..176c4603a59269374bdc61aff6f04aa20bedd282 100644 (file)
@@ -40,7 +40,7 @@ ESL_DECLARE(const char *)cJSON_GetErrorPtr(void) {return ep;}
 static int cJSON_strcasecmp(const char *s1,const char *s2)
 {
        if (!s1) return (s1==s2)?0:1;if (!s2) return 1;
-       for(; tolower(*s1) == tolower(*s2); ++s1, ++s2) if(*s1 == 0)    return 0;
+       for(; tolower(*(const unsigned char *)s1) == tolower(*(const unsigned char *)s2); ++s1, ++s2)   if(*s1 == 0)    return 0;
        return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2);
 }
 
index bd721b372ae63f19a8a78ab836c4868eb947c9f1..a2251651703d65c816a5ed5284f84c66341732ae 100644 (file)
@@ -1 +1 @@
-Tue Mar 18 17:42:45 CDT 2014
+Wed Mar 19 14:23:50 CDT 2014
index 4277ccad7042fc45a85df8e3ecf0eeae8be16c6e..3fc69e36db2b6dd0eea08da5e3fac4cd91520416 100644 (file)
@@ -381,8 +381,8 @@ char const *append_escaped(su_strlst_t *l,
       return NULL;
 
     for (;*n; n++)
-      if (isupper(*n))
-       *n = tolower(*n);
+      if (isupper(*(const unsigned char *)n))
+       *n = tolower(*(const unsigned char *)n);
 
     slen = strlen(s); elen = url_esclen(s, HNV_RESERVED);
 
index eb3e995218c4398063c0b671aa150360ace48d44..7442a346e0eefb23aa9621f53b4e35f2d2721372 100644 (file)
@@ -183,7 +183,7 @@ bm_memcasemem_study0(char const *needle, size_t nlen, bm_fwd_table_t *fwd)
     fwd->table[i] = (unsigned char)nlen;
 
   for (i = 0; i < nlen; i++) {
-    unsigned char n = tolower(needle[i]);
+    unsigned char n = tolower((const unsigned char)needle[i]);
     fwd->table[n] = (unsigned char)(nlen - i - 1);
   }
 
index f9381288a4dc4096f4bc59185e985863e936a5bb..c394895de46d25cb36ff628d0c6efd8ef64e650c 100644 (file)
 
 #include <sys/event.h>
 
+/* INT_TO_UDATA() macros from https://github.com/libevent/libevent */
+
+/* Some platforms apparently define the udata field of struct kevent as
+ * intptr_t, whereas others define it as void*.  There doesn't seem to be an
+ * easy way to tell them apart via autoconf, so we need to use OS macros. */
+#if defined(HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__darwin__) && !defined(__APPLE__)
+#define INT_TO_UDATA(x) ((intptr_t)(x))
+#else
+#define INT_TO_UDATA(x) ((void*)(intptr_t)(x))
+#endif
+
 #define SU_ENABLE_MULTISHOT_KQUEUE 1
 
 #include <stdlib.h>
@@ -246,7 +257,7 @@ int su_kqueue_port_register(su_port_t *self,
   i = ser->ser_id;
 
   flags = (wait->events & SU_WAIT_IN) ? EV_ADD : EV_ADD | EV_DISABLE;
-  EV_SET(ev, wait->fd, EVFILT_READ, flags, 0, 0, (void *)(intptr_t)i);
+  EV_SET(ev, wait->fd, EVFILT_READ, flags, 0, 0, INT_TO_UDATA(i));
   if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
     SU_DEBUG_0(("kevent((%u, %s, %u, %p)) failed: %s\n",
                                wait->fd, "EVFILT_READ", flags, (void *)(intptr_t)i, strerror(errno)));
@@ -254,13 +265,13 @@ int su_kqueue_port_register(su_port_t *self,
   }
 
   flags = (wait->events & SU_WAIT_OUT) ? EV_ADD : EV_ADD | EV_DISABLE;
-  EV_SET(ev, wait->fd, EVFILT_WRITE, flags, 0, 0, (void *)(intptr_t)i);
+  EV_SET(ev, wait->fd, EVFILT_WRITE, flags, 0, 0, INT_TO_UDATA(i));
   if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
     int error = errno;
     SU_DEBUG_0(("kevent((%u, %s, %u, %p)) failed: %s\n",
                                wait->fd, "EVFILT_WRITE", flags, (void *)(intptr_t)i, strerror(error)));
 
-    EV_SET(ev, wait->fd, EVFILT_READ, EV_DELETE, 0, 0, (void *)(intptr_t)i);
+    EV_SET(ev, wait->fd, EVFILT_READ, EV_DELETE, 0, 0, INT_TO_UDATA(i));
     kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL);
 
     errno = error;
@@ -298,14 +309,14 @@ static int su_kqueue_port_deregister0(su_port_t *self, int i, int destroy_wait)
 
   wait = ser->ser_wait;
 
-  EV_SET(ev, wait->fd, EVFILT_READ, EV_DELETE, 0, 0, (void *)(intptr_t)i);
+  EV_SET(ev, wait->fd, EVFILT_READ, EV_DELETE, 0, 0, INT_TO_UDATA(i));
   if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
     SU_DEBUG_0(("remove kevent((%u, %s, %s, %p)) failed: %s\n",
                                wait->fd, "EVFILT_READ", "EV_DELETE", (void *)(intptr_t)i,
                strerror(errno)));
   }
 
-  EV_SET(ev, wait->fd, EVFILT_WRITE, EV_DELETE, 0, 0, (void *)(intptr_t)i);
+  EV_SET(ev, wait->fd, EVFILT_WRITE, EV_DELETE, 0, 0, INT_TO_UDATA(i));
   if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
     SU_DEBUG_0(("remove kevent((%u, %s, %s, %p)) failed: %s\n",
                                wait->fd, "EVFILT_WRITE", "EV_DELETE", (void *)(intptr_t)i,
@@ -465,7 +476,7 @@ int su_kqueue_port_eventmask(su_port_t *self, int index, int socket, int events)
   wait->events = events;
 
   flags = (wait->events & SU_WAIT_IN) ? EV_ADD | EV_ENABLE : EV_ADD | EV_DISABLE;
-  EV_SET(ev, wait->fd, EVFILT_READ, flags, 0, 0, (void *)(intptr_t)index);
+  EV_SET(ev, wait->fd, EVFILT_READ, flags, 0, 0, INT_TO_UDATA(index));
   if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
     SU_DEBUG_0(("modify kevent((%u, %s, %s, %p)) failed: %s\n",
                wait->fd, "EVFILT_READ",
@@ -474,7 +485,7 @@ int su_kqueue_port_eventmask(su_port_t *self, int index, int socket, int events)
   }
 
   flags = (wait->events & SU_WAIT_OUT) ? EV_ADD | EV_ENABLE : EV_ADD | EV_DISABLE;
-  EV_SET(ev, wait->fd, EVFILT_WRITE, flags, 0, 0, (void *)(intptr_t)index);
+  EV_SET(ev, wait->fd, EVFILT_WRITE, flags, 0, 0, INT_TO_UDATA(index));
   if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
     SU_DEBUG_0(("modify kevent((%u, %s, %s, %p)) failed: %s\n",
                wait->fd, "EVFILT_WRITE",
index 8e768b9af428105ac483c6087b81ce6abdfd3cc7..751b94632c46e87825adb9c423f29537e7e99cde 100644 (file)
@@ -384,7 +384,7 @@ static inline int switch_dtmftoi(char *s)
        switch_assert(s);
 
        if (!(r = atoi(s))) {
-               int l = tolower(*s);
+               int l = tolower((unsigned char)*s);
                if (l > 96 && l < 101) {
                        r = l - 87;
                }
index ccdaedb83ef3524c6e1face5ec2a3c0502ed2319..7235e88f6f0d89772da32509ce21e0ddccb1661b 100644 (file)
@@ -40,7 +40,7 @@ SWITCH_DECLARE(const char *)cJSON_GetErrorPtr() {return ep;}
 static int cJSON_strcasecmp(const char *s1,const char *s2)
 {
        if (!s1) return (s1==s2)?0:1;if (!s2) return 1;
-       for(; tolower(*s1) == tolower(*s2); ++s1, ++s2) if(*s1 == 0)    return 0;
+       for(; tolower(*(const unsigned char *)s1) == tolower(*(const unsigned char *)s2); ++s1, ++s2)   if(*s1 == 0)    return 0;
        return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2);
 }