aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-23 12:30:53 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-23 12:30:53 +0000
commitfc3f3eb46fb2213e764c7b15c0e52bc479b92417 (patch)
treeba77bddd3b98d3970f2911d8dc60d6c153387b3f
parenteccea1d34ddf41917648ef846639fa066ba656c6 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@118048 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--include/asterisk/utils.h15
-rw-r--r--main/utils.c14
2 files changed, 15 insertions, 14 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index 3e789019a..cb96dc1ff 100644
--- a/include/asterisk/utils.h
+++ b/include/asterisk/utils.h
@@ -474,20 +474,7 @@ 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(
-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 _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 e03cbbfae..5190f5f64 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -1363,4 +1363,18 @@ int ast_utils_init(void)
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