mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-15 22:38:08 +00:00
add a vasprintf replacement. Bug #839
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* Undefine any macros */
|
||||
#undef malloc
|
||||
@@ -28,6 +29,7 @@
|
||||
#undef realloc
|
||||
#undef strdup
|
||||
#undef strndup
|
||||
#undef vasprintf
|
||||
|
||||
void *__ast_calloc(size_t nmemb, size_t size, const char *file, int lineno, const char *func);
|
||||
void *__ast_malloc(size_t size, const char *file, int lineno, const char *func);
|
||||
@@ -35,6 +37,7 @@ void __ast_free(void *ptr, const char *file, int lineno, const char *func);
|
||||
void *__ast_realloc(void *ptr, size_t size, const char *file, int lineno, const char *func);
|
||||
char *__ast_strdup(const char *s, const char *file, int lineno, const char *func);
|
||||
char *__ast_strndup(const char *s, size_t n, const char *file, int lineno, const char *func);
|
||||
int __ast_vasprintf(char **strp, const char *format, va_list ap, const char *file, int lineno, const char *func);
|
||||
|
||||
void __ast_mm_init(void);
|
||||
|
||||
@@ -58,6 +61,9 @@ void __ast_mm_init(void);
|
||||
#define strndup(a,b) \
|
||||
__ast_strndup(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
|
||||
|
||||
#define vasprintf(a,b,c) \
|
||||
__ast_vasprintf(a,b,c,__FILE__, __LINE__, __PRETTY_FUNCTION__)
|
||||
|
||||
#else
|
||||
#error "NEVER INCLUDE astmm.h DIRECTLY!!"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user