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; } /** @} */