summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2008-05-23 12:37:31 +0000
committerRussell Bryant <russell@russellbryant.com>2008-05-23 12:37:31 +0000
commit61e6ae545ba03b4cff9dbc73fc811e8a27726dee (patch)
tree7fec73405d89f0778b32ef458562855649d02e6b
parentde98d48a0dcc1861be136e0c7a832cd6ecb91dc1 (diff)
Merged revisions 118048 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r118048 | russell | 2008-05-23 07:30:53 -0500 (Fri, 23 May 2008) | 9 lines Don't declare a function that takes variable arguments as inline, because it's not valid, and on some compilers, will emit a warning. http://gcc.gnu.org/onlinedocs/gcc/Inline.html#Inline (closes issue #12289) Reported by: francesco_r Patches by Tilghman, final patch by me ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--include/asterisk/utils.h17
-rw-r--r--main/utils.c16
2 files changed, 18 insertions, 15 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index 59a4360d5..074bc085d 100644
--- a/include/asterisk/utils.h
+++ b/include/asterisk/utils.h
@@ -554,21 +554,8 @@ char * attribute_malloc _ast_strndup(const char *str, size_t len, const char *fi
#define ast_asprintf(ret, fmt, ...) \
_ast_asprintf((ret), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, __VA_ARGS__)
-AST_INLINE_API(
-__attribute__((format (printf, 5, 6)))
-int _ast_asprintf(char **ret, const char *file, int lineno, const char *func, const char *fmt, ...),
-{
- int res;
- va_list ap;
-
- va_start(ap, fmt);
- if ((res = vasprintf(ret, fmt, ap)) == -1)
- MALLOC_FAILURE_MSG;
- va_end(ap);
-
- return res;
-}
-)
+int __attribute__((format (printf, 5, 6)))
+ _ast_asprintf(char **ret, const char *file, int lineno, const char *func, const char *fmt, ...);
/*!
* \brief A wrapper for vasprintf()
diff --git a/main/utils.c b/main/utils.c
index 92da333c3..3946df9a9 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -1632,3 +1632,19 @@ int ast_utils_init(void)
#endif
return 0;
}
+
+#ifndef __AST_DEBUG_MALLOC
+int _ast_asprintf(char **ret, const char *file, int lineno, const char *func, const char *fmt, ...)
+{
+ int res;
+ va_list ap;
+
+ va_start(ap, fmt);
+ if ((res = vasprintf(ret, fmt, ap)) == -1) {
+ MALLOC_FAILURE_MSG;
+ }
+ va_end(ap);
+
+ return res;
+}
+#endif