1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-31 11:23:40 +00:00

(trunk libT) add attribution for the fallback tr_htonll() and tr_ntohll() code

This commit is contained in:
Jordan Lee 2011-03-13 20:39:08 +00:00
parent 58c084fbda
commit 4fc6c1ada2

View file

@ -1658,6 +1658,8 @@ tr_htonll( uint64_t x )
#ifdef HAVE_HTONLL
return htonll( x );
#else
/* fallback code by Runner and Juan Carlos Cobas at
* http://www.codeproject.com/KB/cpp/endianness.aspx */
return (((uint64_t)(htonl((int)((x << 32) >> 32))) << 32) |
(unsigned int)htonl(((int)(x >> 32))));
#endif
@ -1669,6 +1671,8 @@ tr_ntohll( uint64_t x )
#ifdef HAVE_NTOHLL
return ntohll( x );
#else
/* fallback code by Runner and Juan Carlos Cobas at
* http://www.codeproject.com/KB/cpp/endianness.aspx */
return (((uint64_t)(ntohl((int)((x << 32) >> 32))) << 32) |
(unsigned int)ntohl(((int)(x >> 32))));
#endif