From 58d1d59cab7eb0f1e282c5c9e43a790e1a6c2359 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Mon, 11 Jul 2005 23:25:31 +0000 Subject: simplify (and document!) macro for inlinable API functions (inspired by bug #4603, with slightly different implementation) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6090 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- include/asterisk/time.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'include/asterisk/time.h') diff --git a/include/asterisk/time.h b/include/asterisk/time.h index b34ff4f61..ec7a51d8d 100755 --- a/include/asterisk/time.h +++ b/include/asterisk/time.h @@ -14,22 +14,19 @@ #include +#include "asterisk/inline_api.h" + /*! * \brief Computes the difference (in milliseconds) between two \c struct \c timeval instances. * \param end the beginning of the time period * \param start the end of the time period * \return the difference in milliseconds */ -int ast_tvdiff_ms(const struct timeval *end, const struct timeval *start); -#if !defined(LOW_MEMORY) && !defined(AST_API_MODULE) -extern inline -#endif -#if !defined(LOW_MEMORY) || defined(AST_API_MODULE) -int ast_tvdiff_ms(const struct timeval *end, const struct timeval *start) +AST_INLINE_API( +int ast_tvdiff_ms(const struct timeval *end, const struct timeval *start), { return ((end->tv_sec - start->tv_sec) * 1000) + ((end->tv_usec - start->tv_usec) / 1000); } -#endif +) -#undef AST_API_MODULE #endif /* _ASTERISK_TIME_H */ -- cgit v1.2.3