mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
copy the definition of ast_strdupa and use it instead of strdupa to fix the
build on systems that don't have it, such as mac git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@34818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -70,6 +70,18 @@ static int existing_config = 0;
|
||||
/*! This is set when the --check-deps argument is provided. */
|
||||
static int check_deps = 0;
|
||||
|
||||
#if !defined(ast_strdupa) && defined(__GNUC__)
|
||||
#define ast_strdupa(s) \
|
||||
(__extension__ \
|
||||
({ \
|
||||
const char *__old = (s); \
|
||||
size_t __len = strlen(__old) + 1; \
|
||||
char *__new = __builtin_alloca(__len); \
|
||||
memcpy (__new, __old, __len); \
|
||||
__new; \
|
||||
}))
|
||||
#endif
|
||||
|
||||
/*! \brief return a pointer to the first non-whitespace character */
|
||||
static inline char *skip_blanks(char *str)
|
||||
{
|
||||
@@ -516,7 +528,7 @@ static int generate_makeopts_file(void)
|
||||
had_changes = 1;
|
||||
|
||||
if (mem->remove_on_change) {
|
||||
for (buf = strdupa(mem->remove_on_change), file = strsep(&buf, " ");
|
||||
for (buf = ast_strdupa(mem->remove_on_change), file = strsep(&buf, " ");
|
||||
file;
|
||||
file = strsep(&buf, " "))
|
||||
unlink(file);
|
||||
@@ -524,7 +536,7 @@ static int generate_makeopts_file(void)
|
||||
}
|
||||
|
||||
if (cat->remove_on_change && had_changes) {
|
||||
for (buf = strdupa(cat->remove_on_change), file = strsep(&buf, " ");
|
||||
for (buf = ast_strdupa(cat->remove_on_change), file = strsep(&buf, " ");
|
||||
file;
|
||||
file = strsep(&buf, " "))
|
||||
unlink(file);
|
||||
|
Reference in New Issue
Block a user