From b4637cd0a4bcc726fc3376334674b0d7837331f0 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 31 Jul 2021 16:44:46 +0300 Subject: [PATCH] libktorrent: remove win support leftovers Signed-off-by: Ivailo Monev --- libktorrent/src/diskio/cache.cpp | 4 --- libktorrent/src/diskio/cachefile.cpp | 23 ------------ libktorrent/src/diskio/chunk.cpp | 2 -- libktorrent/src/diskio/multifilecache.cpp | 5 --- libktorrent/src/diskio/piecedata.cpp | 14 -------- libktorrent/src/diskio/piecedata.h | 2 -- libktorrent/src/diskio/singlefilecache.cpp | 3 -- libktorrent/src/mse/encryptedpacketsocket.cpp | 4 --- libktorrent/src/net/poll.cpp | 8 ----- libktorrent/src/net/poll.h | 3 -- libktorrent/src/net/socket.cpp | 51 --------------------------- libktorrent/src/peer/connectionlimit.cpp | 4 --- libktorrent/src/peer/peermanager.cpp | 4 --- libktorrent/src/torrent/torrent.cpp | 9 ----- libktorrent/src/torrent/torrentcontrol.cpp | 2 -- libktorrent/src/upnp/upnpmcastsocket.cpp | 10 ------ libktorrent/src/util/fileops.cpp | 33 ----------------- libktorrent/src/util/functions.cpp | 20 ----------- libktorrent/src/util/pipe.cpp | 51 --------------------------- libktorrent/src/util/signalcatcher.cpp | 2 -- libktorrent/src/util/signalcatcher.h | 2 -- libktorrent/src/utp/utpserver.cpp | 3 -- 22 files changed, 259 deletions(-) diff --git a/libktorrent/src/diskio/cache.cpp b/libktorrent/src/diskio/cache.cpp index ed43c859..2bbde5a2 100644 --- a/libktorrent/src/diskio/cache.cpp +++ b/libktorrent/src/diskio/cache.cpp @@ -73,11 +73,7 @@ namespace bt bool Cache::mappedModeAllowed() { -#ifndef Q_WS_WIN return MaxOpenFiles() - bt::PeerManager::connectionLimits().totalConnections() > 100; -#else - return true; //there isn't a file handle limit on windows -#endif } Job* Cache::moveDataFiles(const QMap & files) diff --git a/libktorrent/src/diskio/cachefile.cpp b/libktorrent/src/diskio/cachefile.cpp index 33793800..6348ebc7 100644 --- a/libktorrent/src/diskio/cachefile.cpp +++ b/libktorrent/src/diskio/cachefile.cpp @@ -155,7 +155,6 @@ namespace bt growFile(to_write); } -#ifndef Q_WS_WIN int fd = fptr->handle(); Uint32 page_size = sysconf(_SC_PAGESIZE); if (off % page_size > 0) @@ -213,28 +212,6 @@ namespace bt return ptr; } } -#else // Q_WS_WIN - char* ptr = (char*)fptr->map(off,size); - - if (!ptr) - { - Out(SYS_DIO|LOG_DEBUG) << "mmap failed3 : " << fptr->handle() << " " << QString(strerror(errno)) << endl; - Out(SYS_DIO|LOG_DEBUG) << off << " " << size << endl; - return 0; - } - else - { - CacheFile::Entry e; - e.thing = thing; - e.offset = off; - e.ptr = ptr; - e.diff = 0; - e.size = size; - e.mode = mode; - mappings.insert(ptr,e); - return ptr; - } -#endif } void CacheFile::growFile(Uint64 to_write) diff --git a/libktorrent/src/diskio/chunk.cpp b/libktorrent/src/diskio/chunk.cpp index 2006ebe1..6eb2596c 100644 --- a/libktorrent/src/diskio/chunk.cpp +++ b/libktorrent/src/diskio/chunk.cpp @@ -22,9 +22,7 @@ #include "chunk.h" #include "cache.h" #include "piecedata.h" -#ifndef Q_WS_WIN #include -#endif namespace bt { diff --git a/libktorrent/src/diskio/multifilecache.cpp b/libktorrent/src/diskio/multifilecache.cpp index 8e3d90f7..c93a08b7 100644 --- a/libktorrent/src/diskio/multifilecache.cpp +++ b/libktorrent/src/diskio/multifilecache.cpp @@ -30,9 +30,6 @@ #include #include #include -#ifdef Q_WS_WIN -#include -#endif #include #include "cache.h" #include "chunk.h" @@ -345,7 +342,6 @@ namespace bt for(Uint32 i = 0; i < tor.getNumFiles(); i++) { TorrentFile & tf = tor.getFile(i); -#ifndef Q_WS_WIN // check if the filename is to long if(FileNameToLong(tf.getPathOnDisk())) { @@ -362,7 +358,6 @@ namespace bt tf.setPathOnDisk(s); shortened_names.insert(s); } -#endif touch(tf); if(!tf.doNotDownload()) mount_points.insert(tf.getMountPoint()); diff --git a/libktorrent/src/diskio/piecedata.cpp b/libktorrent/src/diskio/piecedata.cpp index 342d3794..ddceb9c3 100644 --- a/libktorrent/src/diskio/piecedata.cpp +++ b/libktorrent/src/diskio/piecedata.cpp @@ -20,9 +20,7 @@ ***************************************************************************/ #include #include -#ifndef Q_WS_WIN #include -#endif #include "piecedata.h" #include "chunk.h" #include @@ -68,9 +66,7 @@ namespace bt if(read_only) throw bt::Error(i18n("Unable to write to a piece mapped read only")); -#ifndef Q_WS_WIN BUS_ERROR_WPROTECT(); -#endif memcpy(ptr + off, buf, buf_size); return buf_size; } @@ -81,9 +77,7 @@ namespace bt if(off + to_read > len || !ptr) return 0; -#ifndef Q_WS_WIN BUS_ERROR_RPROTECT(); -#endif memcpy(buf, ptr + off, to_read); return to_read; } @@ -93,9 +87,7 @@ namespace bt if(off + size > len || !ptr) return 0; -#ifndef Q_WS_WIN BUS_ERROR_RPROTECT(); -#endif return file.write(ptr + off, size); } @@ -107,9 +99,7 @@ namespace bt if(read_only) throw bt::Error(i18n("Unable to write to a piece mapped read only")); -#ifndef Q_WS_WIN BUS_ERROR_WPROTECT(); -#endif return file.read(ptr + off, size); } @@ -118,9 +108,7 @@ namespace bt if(!ptr) return; -#ifndef Q_WS_WIN BUS_ERROR_RPROTECT(); -#endif hg.update(ptr, len); } @@ -129,9 +117,7 @@ namespace bt if(!ptr) return SHA1Hash(); -#ifndef Q_WS_WIN BUS_ERROR_RPROTECT(); -#endif return SHA1Hash::generate(ptr, len); } diff --git a/libktorrent/src/diskio/piecedata.h b/libktorrent/src/diskio/piecedata.h index bb75faf7..d8af2493 100644 --- a/libktorrent/src/diskio/piecedata.h +++ b/libktorrent/src/diskio/piecedata.h @@ -24,9 +24,7 @@ #include #include #include -#ifndef Q_WS_WIN #include -#endif #include diff --git a/libktorrent/src/diskio/singlefilecache.cpp b/libktorrent/src/diskio/singlefilecache.cpp index a91e9c8b..1895b01a 100644 --- a/libktorrent/src/diskio/singlefilecache.cpp +++ b/libktorrent/src/diskio/singlefilecache.cpp @@ -28,9 +28,6 @@ #include #include #include -#ifdef Q_WS_WIN -#include -#endif #include #include "chunk.h" #include "cachefile.h" diff --git a/libktorrent/src/mse/encryptedpacketsocket.cpp b/libktorrent/src/mse/encryptedpacketsocket.cpp index 2506c070..843d3a75 100644 --- a/libktorrent/src/mse/encryptedpacketsocket.cpp +++ b/libktorrent/src/mse/encryptedpacketsocket.cpp @@ -25,13 +25,9 @@ #include #include #include -#ifndef Q_WS_WIN #include #include #include -#else -#define IPTOS_THROUGHPUT 0x08 -#endif #include #include #include diff --git a/libktorrent/src/net/poll.cpp b/libktorrent/src/net/poll.cpp index e1abd24e..438e9e16 100644 --- a/libktorrent/src/net/poll.cpp +++ b/libktorrent/src/net/poll.cpp @@ -21,11 +21,7 @@ #include "poll.h" #include -#ifndef Q_WS_WIN #include -#else -#include -#endif using namespace bt; @@ -95,11 +91,7 @@ namespace net return 0; int ret = 0; -#ifndef Q_WS_WIN ret = ::poll(&fd_vec[0],num_sockets,timeout); -#else - ret = ::mingw_poll(&fd_vec[0],num_sockets,timeout); -#endif std::map::iterator itr = poll_clients.begin(); while (itr != poll_clients.end()) diff --git a/libktorrent/src/net/poll.h b/libktorrent/src/net/poll.h index 0097ac20..a41d6964 100644 --- a/libktorrent/src/net/poll.h +++ b/libktorrent/src/net/poll.h @@ -27,9 +27,6 @@ #include #include -#ifdef Q_WS_WIN -#include -#endif struct pollfd; diff --git a/libktorrent/src/net/socket.cpp b/libktorrent/src/net/socket.cpp index f29e869a..8116e937 100644 --- a/libktorrent/src/net/socket.cpp +++ b/libktorrent/src/net/socket.cpp @@ -47,12 +47,6 @@ #include -#ifdef Q_WS_WIN -#include -#define SHUT_RDWR SD_BOTH -#undef errno -#define errno WSAGetLastError() -#endif #include using namespace bt; @@ -102,11 +96,7 @@ namespace net if (m_fd >= 0) { shutdown(m_fd, SHUT_RDWR); -#ifdef Q_WS_WIN - ::closesocket(m_fd); -#else ::close(m_fd); -#endif } } @@ -133,11 +123,7 @@ namespace net if (m_fd >= 0) { shutdown(m_fd, SHUT_RDWR); -#ifdef Q_WS_WIN - ::closesocket(m_fd); -#else ::close(m_fd); -#endif m_fd = -1; m_state = CLOSED; } @@ -145,16 +131,11 @@ namespace net void Socket::setBlocking(bool on) { -#ifndef Q_WS_WIN int flag = fcntl(m_fd, F_GETFL, 0); if (!on) fcntl(m_fd, F_SETFL, flag | O_NONBLOCK); else fcntl(m_fd, F_SETFL, flag & ~O_NONBLOCK); -#else - u_long b = on ? 1 : 0; - ioctlsocket(m_fd, FIONBIO, &b); -#endif } bool Socket::connectTo(const Address & a) @@ -164,11 +145,7 @@ namespace net a.toSocketAddress(&ss, len); if (::connect(m_fd,(struct sockaddr*)&ss,len) < 0) { -#ifndef Q_WS_WIN if (errno == EINPROGRESS) -#else - if (errno == WSAEINVAL || errno == WSAEALREADY || errno == WSAEWOULDBLOCK) -#endif { // Out(SYS_CON|LOG_DEBUG) << "Socket is connecting" << endl; m_state = CONNECTING; @@ -194,11 +171,7 @@ namespace net bool Socket::bind(const net::Address& addr, bool also_listen) { int val = 1; -#ifndef Q_WS_WIN if (setsockopt(m_fd,SOL_SOCKET,SO_REUSEADDR,&val,sizeof(int)) < 0) -#else - if (setsockopt(m_fd,SOL_SOCKET,SO_REUSEADDR,(char *)&val,sizeof(int)) < 0) -#endif { Out(SYS_CON|LOG_NOTICE) << QString("Failed to set the reuseaddr option : %1").arg(strerror(errno)) << endl; } @@ -230,11 +203,7 @@ namespace net int Socket::send(const bt::Uint8* buf,int len) { -#ifndef Q_WS_WIN int ret = ::send(m_fd,buf,len,MSG_NOSIGNAL); -#else - int ret = ::send(m_fd,(char *)buf,len,MSG_NOSIGNAL); -#endif if (ret < 0) { if (errno != EAGAIN && errno != EWOULDBLOCK) @@ -249,11 +218,7 @@ namespace net int Socket::recv(bt::Uint8* buf,int max_len) { -#ifndef Q_WS_WIN int ret = ::recv(m_fd,buf,max_len,0); -#else - int ret = ::recv(m_fd,(char *)buf,max_len,0); -#endif if (ret < 0) { if (errno != EAGAIN && errno != EWOULDBLOCK) @@ -296,11 +261,7 @@ namespace net { struct sockaddr_storage ss; socklen_t slen = sizeof(ss); -#ifndef Q_WS_WIN int ret = ::recvfrom(m_fd,buf,max_len,0,(struct sockaddr*)&ss,&slen); -#else - int ret = ::recvfrom(m_fd,(char *)buf,max_len,0,(struct sockaddr*)&ss,&slen); -#endif if (ret < 0) { Out(SYS_CON|LOG_DEBUG) << "Receive error : " << QString(strerror(errno)) << endl; @@ -340,11 +301,7 @@ namespace net #else unsigned char c = type_of_service; #endif -#ifndef Q_WS_WIN if (setsockopt(m_fd,IPPROTO_IP,IP_TOS,&c,sizeof(c)) < 0) -#else - if (setsockopt(m_fd,IPPROTO_IP,IP_TOS,(char *)&c,sizeof(c)) < 0) -#endif { Out(SYS_CON|LOG_NOTICE) << QString("Failed to set TOS to %1 : %2") .arg((int)type_of_service).arg(strerror(errno)) << endl; @@ -370,11 +327,7 @@ namespace net Uint32 Socket::bytesAvailable() const { int ret = 0; -#ifndef Q_WS_WIN if (ioctl(m_fd,FIONREAD,&ret) < 0) -#else - if (ioctlsocket(m_fd,FIONREAD,(u_long*)&ret) < 0) -#endif return 0; return ret; @@ -387,11 +340,7 @@ namespace net int err = 0; socklen_t len = sizeof(int); -#ifndef Q_WS_WIN if (getsockopt(m_fd,SOL_SOCKET,SO_ERROR,&err,&len) < 0) -#else - if (getsockopt(m_fd,SOL_SOCKET,SO_ERROR,(char *)&err,&len) < 0) -#endif return false; if (err == 0) diff --git a/libktorrent/src/peer/connectionlimit.cpp b/libktorrent/src/peer/connectionlimit.cpp index 51760d80..5b4523e1 100644 --- a/libktorrent/src/peer/connectionlimit.cpp +++ b/libktorrent/src/peer/connectionlimit.cpp @@ -25,11 +25,7 @@ namespace bt { static bt::Uint32 SystemConnectionLimit() { -#ifndef Q_WS_WIN return bt::MaxOpenFiles() - 50; // leave about 50 free for regular files -#else - return 9999; // there isn't a real limit on windows -#endif } ConnectionLimit::ConnectionLimit() : diff --git a/libktorrent/src/peer/peermanager.cpp b/libktorrent/src/peer/peermanager.cpp index 46d119a5..fe95af4d 100644 --- a/libktorrent/src/peer/peermanager.cpp +++ b/libktorrent/src/peer/peermanager.cpp @@ -144,11 +144,7 @@ namespace bt void PeerManager::setMaxTotalConnections(Uint32 max) { -#ifndef Q_WS_WIN Uint32 sys_max = bt::MaxOpenFiles() - 50; // leave about 50 free for regular files -#else - Uint32 sys_max = 9999; // there isn't a real limit on windows -#endif max_total_connections = max; if(max == 0 || max_total_connections > sys_max) max_total_connections = sys_max; diff --git a/libktorrent/src/torrent/torrent.cpp b/libktorrent/src/torrent/torrent.cpp index 30e67b2c..c72d8f2a 100644 --- a/libktorrent/src/torrent/torrent.cpp +++ b/libktorrent/src/torrent/torrent.cpp @@ -40,19 +40,10 @@ namespace bt static QString SanityzeName(const QString & name) { QString ret = name; -#ifdef Q_WS_WIN - char invalid[] = {'<','>',':','"','/','\\','|','?','*'}; - for (int i = 0;i < 9;i++) - { - if (ret.contains(invalid[i])) - ret = ret.replace(invalid[i],'_'); - } -#else if (ret.endsWith("/")) ret = ret.left(ret.length() - 1); if (ret.startsWith("/")) ret = ret.mid(1); -#endif // Don't allow directory traversal things in names if (ret.contains("/") || ret.contains("..")) { diff --git a/libktorrent/src/torrent/torrentcontrol.cpp b/libktorrent/src/torrent/torrentcontrol.cpp index d4e3b8a1..952b14dd 100644 --- a/libktorrent/src/torrent/torrentcontrol.cpp +++ b/libktorrent/src/torrent/torrentcontrol.cpp @@ -290,7 +290,6 @@ namespace bt if (moveCompleted) moveToCompletedDir(); } -#ifndef Q_WS_WIN catch (BusError & e) { Out(SYS_DIO | LOG_IMPORTANT) << "Caught SIGBUS " << endl; @@ -299,7 +298,6 @@ namespace bt else onIOError(i18n("Error writing to disk, do you have enough diskspace?")); } -#endif catch (Error & e) { onIOError(e.toString()); diff --git a/libktorrent/src/upnp/upnpmcastsocket.cpp b/libktorrent/src/upnp/upnpmcastsocket.cpp index b14f0b35..04d94f07 100644 --- a/libktorrent/src/upnp/upnpmcastsocket.cpp +++ b/libktorrent/src/upnp/upnpmcastsocket.cpp @@ -22,10 +22,8 @@ #include #include #include -#ifndef Q_WS_WIN #include #include -#endif #include #include #include @@ -260,11 +258,7 @@ namespace bt inet_aton("239.255.255.250",&mreq.imr_multiaddr); mreq.imr_interface.s_addr = htonl(INADDR_ANY); -#ifndef Q_WS_WIN if (setsockopt(fd,IPPROTO_IP,IP_ADD_MEMBERSHIP,&mreq,sizeof(struct ip_mreq)) < 0) -#else - if (setsockopt(fd,IPPROTO_IP,IP_ADD_MEMBERSHIP,(char *)&mreq,sizeof(struct ip_mreq)) < 0) -#endif { Out(SYS_PNP|LOG_NOTICE) << "Failed to join multicast group 239.255.255.250" << endl; } @@ -278,11 +272,7 @@ namespace bt inet_aton("239.255.255.250",&mreq.imr_multiaddr); mreq.imr_interface.s_addr = htonl(INADDR_ANY); -#ifndef Q_WS_WIN if (setsockopt(fd,IPPROTO_IP,IP_DROP_MEMBERSHIP,&mreq,sizeof(struct ip_mreq)) < 0) -#else - if (setsockopt(fd,IPPROTO_IP,IP_DROP_MEMBERSHIP,(char *)&mreq,sizeof(struct ip_mreq)) < 0) -#endif { Out(SYS_PNP|LOG_NOTICE) << "Failed to leave multicast group 239.255.255.250" << endl; } diff --git a/libktorrent/src/util/fileops.cpp b/libktorrent/src/util/fileops.cpp index 08732dbe..bca20c13 100644 --- a/libktorrent/src/util/fileops.cpp +++ b/libktorrent/src/util/fileops.cpp @@ -44,9 +44,6 @@ #include "file.h" #include "array.h" #include "functions.h" -#ifdef Q_WS_WIN -#include "win32.h" -#endif #include "limits.h" @@ -75,12 +72,10 @@ typedef int64_t __s64; #define O_LARGEFILE 0 #endif -#ifndef Q_WS_WIN # ifdef Q_OS_LINUX # include # endif #include -#endif #ifdef CopyFile #undef CopyFile #endif @@ -113,9 +108,7 @@ namespace bt { QStringList sl = dir.split(bt::DirSeparator(),QString::SkipEmptyParts); QString ctmp; -#ifndef Q_WS_WIN ctmp += bt::DirSeparator(); -#endif for (int i = 0;i < sl.count();i++) { @@ -142,9 +135,7 @@ namespace bt { QStringList sl = file.split(bt::DirSeparator()); QString ctmp; -#ifndef Q_WS_WIN ctmp += bt::DirSeparator(); -#endif for (int i = 0;i < sl.count() - 1;i++) { @@ -455,17 +446,6 @@ namespace bt return false; } -#elif defined(Q_WS_WIN) -#ifdef UNICODE - LPCWSTR tpath = (LPCWSTR)path.utf16(); -#else - const char *tpath = path.toLocal8Bit(); -#endif - if(GetDiskFreeSpaceEx(tpath, (PULARGE_INTEGER)&bytes_free, NULL, NULL)) { - return true; - } else { - return false; - } #else return false; #endif @@ -588,7 +568,6 @@ namespace bt Uint64 DiskUsage(const QString& filename) { Uint64 ret = 0; -#ifndef Q_WS_WIN #ifdef HAVE_STAT64 struct stat64 sb; if (stat64(QFile::encodeName(filename),&sb) == 0) @@ -599,19 +578,12 @@ namespace bt { ret = (Uint64)sb.st_blocks * 512; } -#else - DWORD high = 0; - DWORD low = GetCompressedFileSize((LPWSTR)filename.utf16(),&high); - if (low != INVALID_FILE_SIZE) - ret = (high * MAXDWORD) + low; -#endif return ret; } Uint64 DiskUsage(int fd) { Uint64 ret = 0; -#ifndef Q_WS_WIN #ifdef HAVE_FSTAT64 struct stat64 sb; if (fstat64(fd,&sb) == 0) @@ -622,11 +594,6 @@ namespace bt { ret = (Uint64)sb.st_blocks * 512; } -#else - struct _BY_HANDLE_FILE_INFORMATION info; - GetFileInformationByHandle((void *)&fd,&info); - ret = (info.nFileSizeHigh * MAXDWORD) + info.nFileSizeLow; -#endif return ret; } diff --git a/libktorrent/src/util/functions.cpp b/libktorrent/src/util/functions.cpp index fc3da344..72c9faeb 100644 --- a/libktorrent/src/util/functions.cpp +++ b/libktorrent/src/util/functions.cpp @@ -274,23 +274,6 @@ namespace bt } } -#ifdef Q_WS_WIN - static bool InitWindowsSocketsAPI() - { - static bool initialized = false; - if (initialized) - return true; - - WSADATA wsaData; - WORD wVersionRequested = MAKEWORD(2, 2); - int err = WSAStartup( wVersionRequested, &wsaData ); - if (err != 0) - return false; - - initialized = true; - return true; - } -#endif static bool InitGCrypt() { @@ -321,9 +304,6 @@ namespace bt { MaximizeLimits(); bool ret = InitGCrypt(); -#ifdef Q_WS_WIN - ret = InitWindowsSocketsAPI() && ret; -#endif return ret; } diff --git a/libktorrent/src/util/pipe.cpp b/libktorrent/src/util/pipe.cpp index 3dcb1f60..31c49c32 100644 --- a/libktorrent/src/util/pipe.cpp +++ b/libktorrent/src/util/pipe.cpp @@ -31,41 +31,10 @@ namespace bt { -#ifdef Q_WS_WIN - int socketpair(int sockets[2]) - { - sockets[0] = sockets[1] = -1; - - net::Socket sock(true,4); - if (!sock.bind("127.0.0.1",0,true)) - return -1; - - net::Address local_addr = sock.getSockName(); - net::Socket writer(true,4); - writer.setBlocking(false); - writer.connectTo(local_addr); - - net::Address dummy; - sockets[1] = sock.accept(dummy); - if (sockets[1] < 0) - return -1; - - if (!writer.connectSuccesFull()) - { - closesocket(sockets[1]); - return -1; - } - - sockets[0] = writer.take(); - Out(SYS_GEN|LOG_DEBUG) << "Created wakeup pipe" << endl; - return 0; - } -#endif Pipe::Pipe() : reader(-1),writer(-1) { int sockets[2]; -#ifndef Q_WS_WIN if (socketpair(AF_UNIX,SOCK_STREAM,0,sockets) == 0) { reader = sockets[1]; @@ -73,13 +42,6 @@ namespace bt fcntl(writer,F_SETFL,O_NONBLOCK); fcntl(reader,F_SETFL,O_NONBLOCK); } -#else - if (socketpair(sockets) == 0) - { - reader = sockets[1]; - writer = sockets[0]; - } -#endif else { Out(SYS_GEN|LOG_DEBUG) << "Cannot create wakeup pipe" << endl; @@ -88,31 +50,18 @@ namespace bt Pipe::~Pipe() { -#ifndef Q_WS_WIN ::close(reader); ::close(writer); -#else - ::closesocket(reader); - ::closesocket(writer); -#endif } int Pipe::read(Uint8* buffer, int max_len) { -#ifndef Q_WS_WIN return ::read(reader,buffer,max_len); -#else - return ::recv(reader,(char*)buffer,max_len,0); -#endif } int Pipe::write(const bt::Uint8* data, int len) { -#ifndef Q_WS_WIN return ::write(writer,data,len); -#else - return ::send(writer,(char *)data,len,0); -#endif } } diff --git a/libktorrent/src/util/signalcatcher.cpp b/libktorrent/src/util/signalcatcher.cpp index 785312d9..37731ac0 100644 --- a/libktorrent/src/util/signalcatcher.cpp +++ b/libktorrent/src/util/signalcatcher.cpp @@ -23,7 +23,6 @@ #include "signalcatcher.h" #include "log.h" -#ifndef Q_WS_WIN namespace bt { @@ -139,4 +138,3 @@ namespace bt } -#endif diff --git a/libktorrent/src/util/signalcatcher.h b/libktorrent/src/util/signalcatcher.h index ad456683..50395a36 100644 --- a/libktorrent/src/util/signalcatcher.h +++ b/libktorrent/src/util/signalcatcher.h @@ -21,7 +21,6 @@ #ifndef BT_SIGNALCATCHER_H #define BT_SIGNALCATCHER_H -#ifndef Q_WS_WIN #include #include @@ -99,6 +98,5 @@ namespace bt /// Before reading from memory mapped data, call this macro to ensure that SIGBUS signals are caught and properly dealt with #define BUS_ERROR_RPROTECT() BusErrorGuard bus_error_guard; if (sigsetjmp(bt::sigbus_env, 1)) throw bt::BusError(false) -#endif #endif // BT_SIGNALCATCHER_H diff --git a/libktorrent/src/utp/utpserver.cpp b/libktorrent/src/utp/utpserver.cpp index 47f3b96e..59955800 100644 --- a/libktorrent/src/utp/utpserver.cpp +++ b/libktorrent/src/utp/utpserver.cpp @@ -38,9 +38,6 @@ #include "utpserverthread.h" #include "utpsocket.h" -#ifdef Q_WS_WIN -#include -#endif using namespace bt; -- 2.11.0