FSCRE-253 netbsd does not follow opengroup prototypes on toupper and tolower so we have to do stupid workarounds.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10760 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2008-12-15 02:48:50 +00:00
parent 1d7422a1a4
commit 8fb167c779
3 changed files with 112 additions and 9 deletions
+8 -4
View File
@@ -41,6 +41,10 @@
#include <switch.h>
SWITCH_BEGIN_EXTERN_C
SWITCH_DECLARE(int) switch_toupper(int c);
SWITCH_DECLARE(int) switch_tolower(int c);
#define switch_samples_per_packet(rate, interval) ((uint32_t)((float)rate / (1000.0f / (float)interval)))
#define SWITCH_SMAX 32767
#define SWITCH_SMIN -32768
@@ -303,7 +307,7 @@ static inline char *switch_lc_strdup(const char *it)
if (it) {
dup = strdup(it);
for(p = dup; p && *p; p++) {
*p = (char) tolower(*p);
*p = (char) switch_tolower(*p);
}
return dup;
}
@@ -320,7 +324,7 @@ static inline char *switch_uc_strdup(const char *it)
if (it) {
dup = strdup(it);
for(p = dup; p && *p; p++) {
*p = (char) toupper(*p);
*p = (char) switch_toupper(*p);
}
return dup;
}
@@ -353,7 +357,7 @@ static inline switch_bool_t switch_strstr(char *s, char *q)
assert(S != NULL);
for (p = S; p && *p; p++) {
*p = (char) toupper(*p);
*p = (char) switch_toupper(*p);
}
if (strstr(S, q)) {
@@ -365,7 +369,7 @@ static inline switch_bool_t switch_strstr(char *s, char *q)
assert(Q != NULL);
for (p = Q; p && *p; p++) {
*p = (char) toupper(*p);
*p = (char) switch_toupper(*p);
}
if (strstr(s, Q)) {