mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-24 19:52:35 +00:00
deteect 64 bit
This commit is contained in:
parent
e89fe5a03b
commit
ddea76280f
@ -265,6 +265,11 @@ typedef intptr_t switch_ssize_t;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if UINTPTR_MAX == 0xffffffffffffffff
|
||||||
|
#define FS_64BIT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SWITCH_TIME_T_FMT SWITCH_INT64_T_FMT
|
#define SWITCH_TIME_T_FMT SWITCH_INT64_T_FMT
|
||||||
|
@ -51,35 +51,66 @@ static inline uint32_t switch_toupper(uint32_t eax)
|
|||||||
return eax - ebx;
|
return eax - ebx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef FS_64BIT
|
||||||
|
|
||||||
|
static inline void switch_toupper_max(char *s)
|
||||||
|
{
|
||||||
|
uint64_t *b,*p;
|
||||||
|
char *c;
|
||||||
|
size_t l;
|
||||||
|
|
||||||
|
l = strlen(s);
|
||||||
|
|
||||||
|
p = (uint64_t *) s;
|
||||||
|
|
||||||
|
while (l > 8) {
|
||||||
|
b = p;
|
||||||
|
*b = (uint32_t) switch_toupper(*b);
|
||||||
|
b++;
|
||||||
|
p++;
|
||||||
|
l -= 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
c = (char *)p;
|
||||||
|
|
||||||
|
while(l > 0) {
|
||||||
|
*c = (char) switch_toupper(*c);
|
||||||
|
c++;
|
||||||
|
l--;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
static inline void switch_toupper_max(char *s)
|
static inline void switch_toupper_max(char *s)
|
||||||
{
|
{
|
||||||
uint32_t *b,*p;
|
uint32_t *b,*p;
|
||||||
char *c;
|
char *c;
|
||||||
size_t l;
|
size_t l;
|
||||||
int div = 0, rem = 0;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
l = strlen(s);
|
l = strlen(s);
|
||||||
div = (int) (l / 4);
|
|
||||||
rem = l % 4;
|
|
||||||
|
|
||||||
p = (uint32_t *) s;
|
p = (uint32_t *) s;
|
||||||
|
|
||||||
for (i = 0; i < div; i++) {
|
while (l > 4) {
|
||||||
b = p;
|
b = p;
|
||||||
*b = (uint32_t) switch_toupper(*b);
|
*b = (uint32_t) switch_toupper(*b);
|
||||||
b++;
|
b++;
|
||||||
p++;
|
p++;
|
||||||
|
l -= 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
c = (char *)p;
|
c = (char *)p;
|
||||||
|
|
||||||
for (i = 0; i < rem; i++) {
|
while(l > 0) {
|
||||||
*c = (char) switch_toupper(*c);
|
*c = (char) switch_toupper(*c);
|
||||||
c++;
|
c++;
|
||||||
|
l--;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(int) old_switch_toupper(int c);
|
SWITCH_DECLARE(int) old_switch_toupper(int c);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user