]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't declare a function that takes variable arguments as inline, because it's
authorRussell Bryant <russell@russellbryant.com>
Fri, 23 May 2008 12:30:53 +0000 (12:30 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 23 May 2008 12:30:53 +0000 (12:30 +0000)
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/branches/1.4@118048 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/utils.h
main/utils.c

index 3e789019afabb366dd170989bd7b73a910316fb3..cb96dc1ff3f305983edb1971abf49ae927bb5b47 100644 (file)
@@ -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()
index e03cbbfaeb1e44ca02a1af351111b0775187a48d..5190f5f641cd7b128ff58608deecd3f9dda30ba2 100644 (file)
@@ -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