From: Charles Kerr Date: Fri, 2 Jan 2009 05:11:50 +0000 (+0000) Subject: * add autoconf test AC_C_INLINE to do the Right Thing for "inline", "__inline__"... X-Git-Tag: 1.60~601 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e806dc816e083d0527a1f60c7bc21479a850de4;p=transmission * add autoconf test AC_C_INLINE to do the Right Thing for "inline", "__inline__", and "__inline". * make tr_isAddress(), tr_isDirection(), and a bunch of the tr_torrent() macro functions into true inline functions --- diff --git a/configure.ac b/configure.ac index e72e70424..b986567a0 100644 --- a/configure.ac +++ b/configure.ac @@ -47,6 +47,7 @@ AC_SUBST(DBUS_GLIB_MINIMUM) AC_PROG_CC AC_PROG_CXX +AC_C_INLINE if test "x$GCC" = "xyes" ; then CFLAGS="-Wall -Wformat-security -W -Wmissing-prototypes -Wdeclaration-after-statement" CXXFLAGS="-Wall -Wformat-security -W" diff --git a/libtransmission/net.h b/libtransmission/net.h index 1953557ff..4585aea09 100644 --- a/libtransmission/net.h +++ b/libtransmission/net.h @@ -87,7 +87,7 @@ void tr_normalizeV4Mapped( tr_address * const addr ); void tr_suspectAddress( const tr_address * a, const char * source ); -#define tr_isAddress(a) ( ((a)!=NULL) && ( (a)->type==TR_AF_INET || (a)->type==TR_AF_INET6 ) ) +static inline tr_bool tr_isAddress( const tr_address * a ) { return ( a != NULL ) && ( a->type==TR_AF_INET || a->type==TR_AF_INET6 ); } typedef struct tr_net_af_support { diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index 24ff8afdc..c808941dc 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -1415,7 +1415,7 @@ void tr_torrentSetDoneDate( tr_torrent * torrent, time_t doneDate ); /** @brief Sanity checker to test that the direction is TR_UP or TR_DOWN */ -#define tr_isDirection(d) (((d)==TR_UP) || ((d)==TR_DOWN)) +static inline tr_bool tr_isDirection( tr_direction d ) { return d==TR_UP || d==TR_DOWN; } /** @} */