mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 02:40:20 +08:00
cmake: do not use icmping on *nix
This commit is contained in:
parent
b930bc86a3
commit
e887b15e38
@ -1,5 +1,7 @@
|
||||
#include "ICMPPinger.hpp"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
||||
ICMPPinger::ICMPPinger(UINT64 timeout = DEFAULT_TIMEOUT)
|
||||
{
|
||||
// create icmp handle
|
||||
@ -47,3 +49,5 @@ std::pair<std::optional<UINT64>, std::optional<std::string>> ICMPPinger::ping(co
|
||||
PICMP_ECHO_REPLY pReply = (PICMP_ECHO_REPLY) bufRecv.get();
|
||||
return std::pair(pReply->RoundTripTime, std::nullopt);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,17 +1,19 @@
|
||||
#pragma once
|
||||
#include <QtGlobal>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
/**
|
||||
* ICMPPinger - An Implementation of ICMPPing on Windows Platform
|
||||
* Required Windows Version: 2000 / XP / 7 / Vista+
|
||||
* License: WTFPL
|
||||
*/
|
||||
|
||||
#include <icmpapi.h>
|
||||
#include <iphlpapi.h>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
#include <winsock2.h>
|
||||
#include <icmpapi.h>
|
||||
#include <iphlpapi.h>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
#include <winsock2.h>
|
||||
|
||||
class ICMPPinger
|
||||
{
|
||||
@ -29,3 +31,4 @@ class ICMPPinger
|
||||
HANDLE hIcmpFile;
|
||||
UINT64 timeout = DEFAULT_TIMEOUT;
|
||||
};
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user