mirror of
https://github.com/transmission/transmission
synced 2025-03-10 06:02:57 +00:00
* 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
This commit is contained in:
parent
0cd572a0da
commit
5e806dc816
3 changed files with 3 additions and 2 deletions
|
@ -47,6 +47,7 @@ AC_SUBST(DBUS_GLIB_MINIMUM)
|
||||||
|
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_CXX
|
AC_PROG_CXX
|
||||||
|
AC_C_INLINE
|
||||||
if test "x$GCC" = "xyes" ; then
|
if test "x$GCC" = "xyes" ; then
|
||||||
CFLAGS="-Wall -Wformat-security -W -Wmissing-prototypes -Wdeclaration-after-statement"
|
CFLAGS="-Wall -Wformat-security -W -Wmissing-prototypes -Wdeclaration-after-statement"
|
||||||
CXXFLAGS="-Wall -Wformat-security -W"
|
CXXFLAGS="-Wall -Wformat-security -W"
|
||||||
|
|
|
@ -87,7 +87,7 @@ void tr_normalizeV4Mapped( tr_address * const addr );
|
||||||
|
|
||||||
void tr_suspectAddress( const tr_address * a, const char * source );
|
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
|
typedef struct tr_net_af_support
|
||||||
{
|
{
|
||||||
|
|
|
@ -1415,7 +1415,7 @@ void tr_torrentSetDoneDate( tr_torrent * torrent,
|
||||||
time_t doneDate );
|
time_t doneDate );
|
||||||
|
|
||||||
/** @brief Sanity checker to test that the direction is TR_UP or TR_DOWN */
|
/** @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; }
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue