[asterisk-commits] russell: branch 1.4 r118048 - in /branches/1.4: include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 23 07:30:54 CDT 2008


Author: russell
Date: Fri May 23 07:30:53 2008
New Revision: 118048

URL: http://svn.digium.com/view/asterisk?view=rev&rev=118048
Log:
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

Modified:
    branches/1.4/include/asterisk/utils.h
    branches/1.4/main/utils.c

Modified: branches/1.4/include/asterisk/utils.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/utils.h?view=diff&rev=118048&r1=118047&r2=118048
==============================================================================
--- branches/1.4/include/asterisk/utils.h (original)
+++ branches/1.4/include/asterisk/utils.h Fri May 23 07:30:53 2008
@@ -474,20 +474,7 @@
 #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()

Modified: branches/1.4/main/utils.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/utils.c?view=diff&rev=118048&r1=118047&r2=118048
==============================================================================
--- branches/1.4/main/utils.c (original)
+++ branches/1.4/main/utils.c Fri May 23 07:30:53 2008
@@ -1363,4 +1363,18 @@
 	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




More information about the asterisk-commits mailing list