]> granicus.if.org Git - transmission/commitdiff
* add autoconf test AC_C_INLINE to do the Right Thing for "inline", "__inline__"...
authorCharles Kerr <charles@transmissionbt.com>
Fri, 2 Jan 2009 05:11:50 +0000 (05:11 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Fri, 2 Jan 2009 05:11:50 +0000 (05:11 +0000)
* make tr_isAddress(), tr_isDirection(), and a bunch of the tr_torrent() macro functions into true inline functions

configure.ac
libtransmission/net.h
libtransmission/transmission.h

index e72e7042430772cf96779275b8eb3adcba71f476..b986567a0d80c87be54071e1ae04090b403413b9 100644 (file)
@@ -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"
index 1953557fff659e05b0ab8162786928f8aa9e61a0..4585aea0996a13744bbfbc3186f361025cdd6f00 100644 (file)
@@ -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
 {
index 24ff8afdc20d5db5f0833f864d6ede66c4a91097..c808941dca22517bb94d5d127526b7fa23552e4f 100644 (file)
@@ -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; }
 
 /** @} */