mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 01:26:58 +00:00
FS-2746 --resolve large xmlrpc update thanks garmt
This commit is contained in:
@@ -11,6 +11,14 @@
|
||||
long long mask= ULL(1) << 33;
|
||||
*/
|
||||
|
||||
/* 'uint' is quite convenient, but there's no simple way have it everywhere.
|
||||
Some systems have it in the base system (e.g. GNU C library has it in
|
||||
<sys/types.h>, and others (e.g. Solaris - 08.12.02) don't. Since we
|
||||
can't define it unless we know it's not defined already, and we don't
|
||||
want to burden the reader with a special Xmlrpc-c name such as xuint,
|
||||
we just use standard "unsigned int" instead.
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define PRId64 "I64d"
|
||||
# define PRIu64 "I64u"
|
||||
@@ -33,9 +41,6 @@ typedef __int64 int64_t;
|
||||
#ifndef uint64_t
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#endif
|
||||
#ifndef uint
|
||||
typedef unsigned int uint;
|
||||
#endif
|
||||
#ifndef uint8_t
|
||||
typedef unsigned char uint8_t;
|
||||
#endif
|
||||
@@ -44,6 +49,11 @@ typedef unsigned char uint8_t;
|
||||
#define LL(x) x ## i64
|
||||
#define ULL(x) x ## u64
|
||||
|
||||
#elif defined(__INTERIX)
|
||||
# include <stdint.h>
|
||||
# define PRId64 "I64d"
|
||||
# define PRIu64 "I64u"
|
||||
|
||||
#else
|
||||
/* Not Microsoft compiler */
|
||||
#include <inttypes.h>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
static __inline__ void
|
||||
mallocProduct(void ** const resultP,
|
||||
unsigned int const factor1,
|
||||
unsigned int const factor2) {
|
||||
size_t const factor2) {
|
||||
/*----------------------------------------------------------------------------
|
||||
malloc a space whose size in bytes is the product of 'factor1' and
|
||||
'factor2'. But if that size cannot be represented as an unsigned int,
|
||||
@@ -102,7 +102,7 @@ do { \
|
||||
|
||||
|
||||
#define MALLOCVAR(varName) \
|
||||
if (varName = malloc(sizeof(*varName))) memset(varName, 0, sizeof(*varName))
|
||||
varName = malloc(sizeof(*varName))
|
||||
|
||||
#define MALLOCVAR_NOFAIL(varName) \
|
||||
do {if ((varName = malloc(sizeof(*varName))) == NULL) abort();} while(0)
|
||||
|
@@ -26,10 +26,12 @@
|
||||
#ifndef PTHREADX_H_INCLUDED
|
||||
#define PTHREADX_H_INCLUDED
|
||||
|
||||
#ifndef WIN32
|
||||
#include "xmlrpc_config.h"
|
||||
|
||||
#if HAVE_PTHREAD
|
||||
# define _REENTRANT
|
||||
# include <pthread.h>
|
||||
#elif defined (WIN32)
|
||||
#elif HAVE_WINDOWS_THREAD
|
||||
#include <windows.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -52,11 +54,7 @@ struct {
|
||||
int attrs; /* currently unused. placeholder. */
|
||||
} pthread_mutexattr_t;
|
||||
|
||||
/* We make pthread_func identical to a Windows thread start function
|
||||
so we can use Windows thread functions to implement these pthread
|
||||
functions directly.
|
||||
*/
|
||||
typedef unsigned (WINAPI pthread_func)(void *);
|
||||
typedef void * pthread_func(void *);
|
||||
|
||||
extern int pthread_create(pthread_t * const new_thread_ID,
|
||||
const pthread_attr_t * const attr,
|
||||
@@ -75,6 +73,10 @@ extern int pthread_mutex_destroy(pthread_mutex_t * const mp);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* WIN32 */
|
||||
#else /* HAVE_WINDOWS_THREAD */
|
||||
#error "You don't have any thread facility. (According to "
|
||||
#error "HAVE_PTHREAD and HAVE_WINDOWS_THREAD macros defined in "
|
||||
#error "xmlrpc_config.h)"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -1,15 +0,0 @@
|
||||
#ifndef SSTRING_H_INCLUDED
|
||||
#define SSTRING_H_INCLUDED
|
||||
|
||||
/* This file contains string functions that are cognizant of the
|
||||
declared size of the destination data structure.
|
||||
*/
|
||||
|
||||
|
||||
/* Copy string pointed by B to array A with size checking. */
|
||||
#define SSTRCPY(A,B) \
|
||||
(strncpy((A), (B), sizeof(A)), *((A)+sizeof(A)-1) = '\0')
|
||||
#define SSTRCMP(A,B) \
|
||||
(strncmp((A), (B), sizeof(A)))
|
||||
|
||||
#endif
|
@@ -56,7 +56,7 @@ init_va_listx(va_listx * const argsxP,
|
||||
#if VA_LIST_IS_ARRAY
|
||||
/* 'args' is NOT a va_list. It is a pointer to the first element of a
|
||||
'va_list', which is the same address as a pointer to the va_list
|
||||
itself.
|
||||
itself. (That's what happens when you pass an array in C).
|
||||
*/
|
||||
memcpy(&argsxP->v, args, sizeof(argsxP->v));
|
||||
#else
|
||||
|
Reference in New Issue
Block a user