git: 18a2b540d1ec - 2026Q2 - net/sniffnet: fix build on armv7

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Fri, 26 Jun 2026 12:15:58 UTC
The branch 2026Q2 has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=18a2b540d1ecc678e2203dcdab09e1d7a755c3b2

commit 18a2b540d1ecc678e2203dcdab09e1d7a755c3b2
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2026-06-22 21:51:14 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2026-06-26 12:11:50 +0000

    net/sniffnet: fix build on armv7
    
    The usual issue of time_t being 64 bits on armv7 despite it being a
    32 bit platform.  Refactor the time conversion code to just use i64
    throughout, avoiding any type conversion issues.
    
    Approved by:    portmgr (build fix blanket)
    See also:       0c9905d54dedcf8763df802a01beb2ea3d4ac4a0
    MFH:            2026Q2
    
    (cherry picked from commit 379fd8b722576e2f665add52cc70f445ca15205a)
---
 .../patch-cargo-crates_cpal-0.17.3_src_host_alsa_mod.rs   | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/net/sniffnet/files/patch-cargo-crates_cpal-0.17.3_src_host_alsa_mod.rs b/net/sniffnet/files/patch-cargo-crates_cpal-0.17.3_src_host_alsa_mod.rs
new file mode 100644
index 000000000000..59720d90f687
--- /dev/null
+++ b/net/sniffnet/files/patch-cargo-crates_cpal-0.17.3_src_host_alsa_mod.rs
@@ -0,0 +1,15 @@
+--- cargo-crates/cpal-0.17.3/src/host/alsa/mod.rs.orig	2026-06-22 08:56:54 UTC
++++ cargo-crates/cpal-0.17.3/src/host/alsa/mod.rs
+@@ -1106,11 +1106,8 @@ fn timespec_to_nanos(ts: libc::timespec) -> i64 {
+ // https://fossies.org/linux/alsa-lib/test/audio_time.c
+ #[inline]
+ fn timespec_to_nanos(ts: libc::timespec) -> i64 {
+-    let nanos = ts.tv_sec * 1_000_000_000 + ts.tv_nsec;
+-    #[cfg(target_pointer_width = "64")]
++    let nanos = ts.tv_sec as i64 * 1_000_000_000 + ts.tv_nsec as i64;
+     return nanos;
+-    #[cfg(not(target_pointer_width = "64"))]
+-    return nanos.into();
+ }
+ 
+ // Adapted from `timediff` here: