Skip to content

Commit

Permalink
pcapplusplus: disable -Werror and fix Clang's warning (#5742)
Browse files Browse the repository at this point in the history
* pcapplusplus: patch for `-Werror=overloaded-virtual`

* pcapplusplus: no warning as error
  • Loading branch information
Doekin authored Nov 12, 2024
1 parent b833453 commit 885ea60
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
44 changes: 44 additions & 0 deletions packages/p/pcapplusplus/patches/v24.09/explicit-override.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff --git a/Pcap++/header/WinPcapLiveDevice.h b/Pcap++/header/WinPcapLiveDevice.h
index 9cc5a501..816a96cf 100644
--- a/Pcap++/header/WinPcapLiveDevice.h
+++ b/Pcap++/header/WinPcapLiveDevice.h
@@ -1,10 +1,8 @@
#pragma once

-#if defined(_WIN32)
-
/// @file

-# include "PcapLiveDevice.h"
+#include "PcapLiveDevice.h"

/**
* \namespace pcpp
@@ -34,17 +32,17 @@ namespace pcpp
WinPcapLiveDevice& operator=(const WinPcapLiveDevice& other);

public:
- virtual LiveDeviceType getDeviceType() const
+ LiveDeviceType getDeviceType() const override
{
return WinPcapDevice;
}

bool startCapture(OnPacketArrivesCallback onPacketArrives, void* onPacketArrivesUserCookie,
int intervalInSecondsToUpdateStats, OnStatsUpdateCallback onStatsUpdate,
- void* onStatsUpdateUserCookie);
+ void* onStatsUpdateUserCookie) override;
bool startCapture(int intervalInSecondsToUpdateStats, OnStatsUpdateCallback onStatsUpdate,
- void* onStatsUpdateUserCookie);
- bool startCapture(RawPacketVector& capturedPacketsVector)
+ void* onStatsUpdateUserCookie) override;
+ bool startCapture(RawPacketVector& capturedPacketsVector) override
{
return PcapLiveDevice::startCapture(capturedPacketsVector);
}
@@ -76,5 +74,3 @@ namespace pcpp
};

} // namespace pcpp
-
-#endif // _WIN32
2 changes: 2 additions & 0 deletions packages/p/pcapplusplus/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package("pcapplusplus")
add_versions("v23.09", "f2b92d817df6138363be0d144a61716f8ecc43216f0008135da2e0e15727d35a")

add_patches("v24.09", "patches/v24.09/vla.patch", "8c380468c78118b6d85f6b3856cd49c4d890fd326dde3400b8c47c01c885cef4")
add_patches("v24.09", "patches/v24.09/explicit-override.patch", "d4ff15e920ea4996f6d3105e898e42d75cfab47b7e930467442ae356a361cf25")

add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})

Expand All @@ -34,6 +35,7 @@ package("pcapplusplus")
local configs = {
"-DPCAPPP_BUILD_EXAMPLES=OFF",
"-DPCAPPP_BUILD_TESTS=OFF",
"--compile-no-warning-as-error",
}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
import("package.tools.cmake").install(package, configs)
Expand Down

0 comments on commit 885ea60

Please sign in to comment.