mingw portability fixes
This commit is contained in:
parent
d40a341c76
commit
3a6396a3cb
|
@ -15,7 +15,6 @@
|
|||
#include <inttypes.h> /* uint8_t */
|
||||
#include <string.h> /* memcpy */
|
||||
#include <stdarg.h>
|
||||
#include <netinet/in.h> /* struct in_addr */
|
||||
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/dh.h>
|
||||
|
|
|
@ -14,7 +14,13 @@
|
|||
#define TR_PEER_MGR_PRIVATE_H
|
||||
|
||||
#include <inttypes.h> /* uint16_t */
|
||||
|
||||
#ifdef WIN32
|
||||
#include <winsock2.h> /* struct in_addr */
|
||||
#else
|
||||
#include <netinet/in.h> /* struct in_addr */
|
||||
#endif
|
||||
|
||||
#include "publish.h" /* tr_publisher_tag */
|
||||
|
||||
struct tr_bitfield;
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include <limits.h> /* INT_MAX */
|
||||
|
||||
#include <libgen.h> /* basename */
|
||||
#include <arpa/inet.h> /* inet_ntoa */
|
||||
|
||||
#include <event.h>
|
||||
|
||||
|
@ -742,7 +741,7 @@ getPreferredBlocks( Torrent * t, uint64_t * setmeCount )
|
|||
memcpy( walk, req[s], sizeof(uint64_t) * reqCount[s] );
|
||||
walk += reqCount[s];
|
||||
}
|
||||
assert( ( walk - ret ) == blockCount );
|
||||
assert( ( walk - ret ) == ( int )blockCount );
|
||||
*setmeCount = blockCount;
|
||||
|
||||
/* cleanup */
|
||||
|
|
|
@ -14,7 +14,12 @@
|
|||
#define TR_PEER_MGR_H
|
||||
|
||||
#include <inttypes.h> /* uint16_t */
|
||||
|
||||
#ifdef WIN32
|
||||
#include <winsock2.h> /* struct in_addr */
|
||||
#else
|
||||
#include <netinet/in.h> /* struct in_addr */
|
||||
#endif
|
||||
|
||||
struct in_addr;
|
||||
struct tr_handle;
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
#include <string.h>
|
||||
#include <libgen.h> /* basename */
|
||||
|
||||
#include <netinet/in.h> /* struct in_addr */
|
||||
|
||||
#include <event.h>
|
||||
|
||||
#include "transmission.h"
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
* DEALINGS IN THE SOFTWARE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include <string.h> /* strcmp, strchr */
|
||||
#include <libgen.h> /* basename */
|
||||
|
||||
#include <sys/queue.h> /* evhttp.h needs this */
|
||||
#include <event.h>
|
||||
#include <evhttp.h>
|
||||
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#include <signal.h>
|
||||
#include <sys/queue.h> /* for evhttp */
|
||||
#include <sys/types.h> /* for evhttp */
|
||||
|
||||
#include <event.h>
|
||||
#include <evdns.h>
|
||||
|
|
|
@ -94,7 +94,12 @@ tr_getLogTimeStr( char * buf, int buflen )
|
|||
now = time( NULL );
|
||||
gettimeofday( &tv, NULL );
|
||||
|
||||
#ifdef WIN32
|
||||
now_tm = *localtime( &now );
|
||||
#else
|
||||
localtime_r( &now, &now_tm );
|
||||
#endif
|
||||
|
||||
strftime( tmp, sizeof(tmp), "%H:%M:%S", &now_tm );
|
||||
milliseconds = (int)(tv.tv_usec / 1000);
|
||||
snprintf( buf, buflen, "%s.%03d", tmp, milliseconds );
|
||||
|
|
Loading…
Reference in New Issue