diff --git a/src/components/icmping/win/ICMPPinger.cpp b/src/components/icmping/win/ICMPPinger.cpp index 2a1de164..287c0cf8 100644 --- a/src/components/icmping/win/ICMPPinger.cpp +++ b/src/components/icmping/win/ICMPPinger.cpp @@ -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> ICMPPinger::ping(co PICMP_ECHO_REPLY pReply = (PICMP_ECHO_REPLY) bufRecv.get(); return std::pair(pReply->RoundTripTime, std::nullopt); } + +#endif diff --git a/src/components/icmping/win/ICMPPinger.hpp b/src/components/icmping/win/ICMPPinger.hpp index f0bfa39e..b657767e 100644 --- a/src/components/icmping/win/ICMPPinger.hpp +++ b/src/components/icmping/win/ICMPPinger.hpp @@ -1,17 +1,19 @@ #pragma once +#include +#ifdef Q_OS_WIN /** * ICMPPinger - An Implementation of ICMPPing on Windows Platform * Required Windows Version: 2000 / XP / 7 / Vista+ * License: WTFPL */ -#include -#include -#include -#include -#include -#include + #include + #include + #include + #include + #include + #include class ICMPPinger { @@ -29,3 +31,4 @@ class ICMPPinger HANDLE hIcmpFile; UINT64 timeout = DEFAULT_TIMEOUT; }; +#endif