From nobody Fri Mar 24 09:36:31 2023 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PjcY72pRMz41LWM; Fri, 24 Mar 2023 09:36:43 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PjcY71pGhz3hh1; Fri, 24 Mar 2023 09:36:43 +0000 (UTC) (envelope-from eduardo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679650603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Hbp3zeVbwa9sdFGDQ112UoSKJ3h4WypWNiapw8q+kyU=; b=ky170rrkUm7DCBs0naKcyuWRi5G8t1Fn5uzLQTxCGeTTJzWNXfjDMaNKqlbckzpsS4hXwD qSy5FHbPjj9sWEB/FYW7znVo7BCgLXpGsqs95e+s01DswQDOHjP3LKlWSK6Iac+GY8Icvt lPaZSiNxYkpXPr0iuSV+sq3xDvXMEAD9aMIeVafMvB6f8fadk0jJqr1IVQUOBQV0RI1fwx 4OR8xUSVE3oMsEF29/GlYiMVy7YetCYppXZzg93I3MnbYpdpHLFn/K9qd9yK4nE/ehrpGm GZWw437djF0q0NrQkYO+UjdbQdDq2gxHkaXSEKvyqPP+NY/IthXBoHlPl/fk8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679650603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Hbp3zeVbwa9sdFGDQ112UoSKJ3h4WypWNiapw8q+kyU=; b=OuvIQIEBYMf4m2vh1u1HmgG4DpLKoGk9wnas7rcQvw+kXqO3KD3MUp7u7xxjJKZ7Xpa8Lx Zn2C6jGKmq40orP017qpqu+V6TGmrD9uvtkTtmsVECA7t4BMhTS/2ZbUAOGBP4mnt2OsJA d26L6/lLVQtdlkCu0h/D5NQ0lgtM+x5TpjeA9AU/kDEOR8bxINAST4WGjYaBDMZlsgLy2H MmQ3msahmIWP2yKD0nfsccY4oPO+E3lwAinTlzGZ9hN1xutoGBcP9xylN5t8l3puo9xrQz KOeA5iizaPKuF2LZ4h8AUYOuBHtPB6hq4vtt9wf7pxB1ZztUvaNAxblVIAKqog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679650603; a=rsa-sha256; cv=none; b=OoTRs00i7G4DWRbrZYJ6ZyVJc7YwBgVp+YvFrl64QL1XxRKWiZZv5vE71eHuJ15+s/JldS kPVOxLtfpJslelHmjRyC1OkPRM/rsCE2FxHIZ5OzMIQ+fdakq9Zlho/hoHJJycRIyTY5B1 ROzZ+mlgY+6uoRgoyLpAnQX2D/DYULtxivlyhJVWah0huCGSfwLjAqAM+c9gLVzp13MiSA ib97ONWX9ikXm3eS4UNuXeVQ05cThUDDqAHjWilkuGZLU2srEuvl1QNi9Fsy6NEu04Bq4q E46DNQSscXcYdCUMRamuXtsMsTuoVxQsduEIqHrbh81p2iFpThqA5hLgnoQ3Hw== Received: from mail-ua1-f44.google.com (mail-ua1-f44.google.com [209.85.222.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: eduardo) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PjcY70llMzyQh; Fri, 24 Mar 2023 09:36:43 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: by mail-ua1-f44.google.com with SMTP id g9so973039uam.9; Fri, 24 Mar 2023 02:36:43 -0700 (PDT) X-Gm-Message-State: AAQBX9dUel0N2FBstw8Mh85Du7eRhnSIJkl0oXAX0UmbNlcoSQaQyAgq X2PBIJY5cttYReV3eV1eGuMln1SxVnfFjykBEbQ= X-Google-Smtp-Source: AKy350Z9YxvjknzFhBWC5a0c2MMW3wYN5fxY9vCV7zbqzW4GEIQNKmBTeRYejEsvg30jP/vVUZTOdt3Yu7BvJ9XkGrM= X-Received: by 2002:a1f:1d15:0:b0:435:56e:154e with SMTP id d21-20020a1f1d15000000b00435056e154emr1133230vkd.1.1679650602721; Fri, 24 Mar 2023 02:36:42 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 References: <13BBF767-6CBB-41D5-AD93-6ADD9C417811@FreeBSD.org> In-Reply-To: <13BBF767-6CBB-41D5-AD93-6ADD9C417811@FreeBSD.org> From: Nuno Teixeira Date: Fri, 24 Mar 2023 09:36:31 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: byteswap.h not found on 12 and 13 To: Juraj Lutter Cc: Warner Losh , Yuri , FreeBSD CURRENT , FreeBSD Mailing List Content-Type: multipart/alternative; boundary="00000000000085a8cf05f7a22185" X-ThisMailContainsUnwantedMimeParts: N --00000000000085a8cf05f7a22185 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Juraj, --- --- src/sflowtool.c.orig 2023-03-24 09:29:58 UTC +++ src/sflowtool.c @@ -29,13 +29,18 @@ extern "C" { #include #include #include -#include +#include #include #include "sflow.h" /* sFlow v5 */ #include "sflow_v2v4.h" /* sFlow v2/4 */ #include "assert.h" #include "sflow_xdr.h" /* sFlow encode */ + +#define bswap_16 bswap16 +#define bswap_32 bswap32 +#define bswap_64 bswap64 #define SPOOFSOURCE 1 #define YES 1 --- Compiles fine! Juraj Lutter escreveu no dia sexta, 24/03/2023 =C3=A0(s) 09:13: > > > > On 24 Mar 2023, at 10:09, Warner Losh wrote: > > > > one last reply, if this is for a port, then byteswap.h can usually be > implemented as > > > > #include > > #define __bswap_16(x) __bswap16(x) > > #define __bswap_32(x) __bswap32(x) > > #define __bswap_64(x) __bswap64(x) > > > > #define bswap_16(x) __bswap16(x) > > #define bswap_32(x) __bswap32(x) > > #define bswap_64(x) __bswap64(x) > > > > in older versions of FreeBSD, but some tricky software will hate the > bswap16 (no underscore) etc defines. You could likely put that into the > port. > > In releng/13 there is also infiniband/byteswap.h that does: > > #include > #include > > #define bswap_16 bswap16 > #define bswap_32 bswap32 > #define bswap_64 bswap64 > > otis > > =E2=80=94 > Juraj Lutter > otis@FreeBSD.org > > --=20 Nuno Teixeira FreeBSD Committer (ports) --00000000000085a8cf05f7a22185 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Juraj,

---
--- src/sflowtool.c.orig =C2=A0 =C2=A0 =C2=A0 =C2=A02023-03-24 09:29:58 = UTC
+++ src/sflowtool.c
@@ -29,13 +29,18 @@ extern "C" {=C2=A0#include <inttypes.h>
=C2=A0#include <arpa/inet.h>=C2=A0#include <netdb.h>
-#include <byteswap.h>
+#includ= e <sys/endian.h>
=C2=A0#include <getopt.h>

=C2=A0#inc= lude "sflow.h" /* sFlow v5 */
=C2=A0#include "sflow_v2v4.= h" /* sFlow v2/4 */
=C2=A0#include "assert.h"
=C2=A0#i= nclude "sflow_xdr.h" /* sFlow encode */
+
+#define bswap_16= bswap16
+#define bswap_32 bswap32
+#define bswap_64 bswap64

= =C2=A0#define SPOOFSOURCE 1
=C2=A0#define YES 1
---
=
Compiles fine!

Juraj Lutter <otis@freebsd.org> escreveu no dia sexta, 24/03/2023= =C3=A0(s) 09:13:
imp@bsdimp.com> wrote:
>
> one last reply, if this is for a port, then byteswap.h can usually be = implemented as
>
> #include <sys/endian.h>
> #define __bswap_16(x) __bswap16(x)
> #define __bswap_32(x) __bswap32(x)
> #define __bswap_64(x) __bswap64(x)
>
> #define bswap_16(x) __bswap16(x)
> #define bswap_32(x) __bswap32(x)
> #define bswap_64(x) __bswap64(x)
>
> in older versions of FreeBSD, but some tricky software will hate the b= swap16 (no underscore) etc defines. You could likely put that into the port= .

In releng/13 there is also infiniband/byteswap.h that does:

#include <sys/types.h>
#include <sys/endian.h>

#define bswap_16=C2=A0 =C2=A0 =C2=A0 =C2=A0 bswap16
#define bswap_32=C2=A0 =C2=A0 =C2=A0 =C2=A0 bswap32
#define bswap_64=C2=A0 =C2=A0 =C2=A0 =C2=A0 bswap64

otis

=E2=80=94
Juraj Lutter
otis@FreeBSD.org



--
Nuno Teixeira
FreeBSD Committ= er (ports)
--00000000000085a8cf05f7a22185--