Date: Fri, 24 Mar 2023 09:36:31 +0000 From: Nuno Teixeira <eduardo@freebsd.org> To: Juraj Lutter <otis@freebsd.org> Cc: Warner Losh <imp@bsdimp.com>, Yuri <yuri@aetern.org>, FreeBSD CURRENT <freebsd-current@freebsd.org>, FreeBSD Mailing List <freebsd-ports@freebsd.org> Subject: Re: byteswap.h not found on 12 and 13 Message-ID: <CAFDf7ULi96TAb49OW8jBO6vVOzc%2BCkNgQiDQcd-ivxKCsXsAHw@mail.gmail.com> In-Reply-To: <13BBF767-6CBB-41D5-AD93-6ADD9C417811@FreeBSD.org> References: <CAFDf7UKq3bMgd3XA0=U10%2BLhOCY7fZCHds9DdBcrSuNidOityw@mail.gmail.com> <CANCZdfpT3nbZ%2BzHHtdsMDa88JsWr7Frw%2BRPGcy6B=P60DZL2_g@mail.gmail.com> <CAFDf7UL=av0KDAw2O3Fmf=x5wThezBokCQ2KHtW6wOZnn43bxQ@mail.gmail.com> <ef18fee5-358b-3c19-467b-2fd980dff797@aetern.org> <CANCZdfrvHQTZqgGdZjm5Z_fa53g92c_6EHtKZpyRAsKwRsDcLw@mail.gmail.com> <CANCZdfp=zTD5ctpjcQhDBexWP40d=z0GAd09Qa9eFM4yxXq9RQ@mail.gmail.com> <CANCZdfq2nLt1Bq2Jzn=ivvqaOvF9=y8j=ChZzy6TrE5zAzeFiw@mail.gmail.com> <13BBF767-6CBB-41D5-AD93-6ADD9C417811@FreeBSD.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
Hello Juraj,
---
--- src/sflowtool.c.orig 2023-03-24 09:29:58 UTC
+++ src/sflowtool.c
@@ -29,13 +29,18 @@ extern "C" {
#include <inttypes.h>
#include <arpa/inet.h>
#include <netdb.h>
-#include <byteswap.h>
+#include <sys/endian.h>
#include <getopt.h>
#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 <otis@freebsd.org> escreveu no dia sexta, 24/03/2023 à(s)
09:13:
>
>
> > On 24 Mar 2023, at 10:09, Warner Losh <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
> 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 <sys/types.h>
> #include <sys/endian.h>
>
> #define bswap_16 bswap16
> #define bswap_32 bswap32
> #define bswap_64 bswap64
>
> otis
>
> —
> Juraj Lutter
> otis@FreeBSD.org
>
>
--
Nuno Teixeira
FreeBSD Committer (ports)
[-- Attachment #2 --]
<div dir="ltr"><div>Hello Juraj,</div><div><br></div><div>---<br></div><div>--- src/sflowtool.c.orig 2023-03-24 09:29:58 UTC<br>+++ src/sflowtool.c<br>@@ -29,13 +29,18 @@ extern "C" {<br> #include <inttypes.h><br> #include <arpa/inet.h><br> #include <netdb.h><br>-#include <byteswap.h><br>+#include <sys/endian.h><br> #include <getopt.h><br><br> #include "sflow.h" /* sFlow v5 */<br> #include "sflow_v2v4.h" /* sFlow v2/4 */<br> #include "assert.h"<br> #include "sflow_xdr.h" /* sFlow encode */<br>+<br>+#define bswap_16 bswap16<br>+#define bswap_32 bswap32<br>+#define bswap_64 bswap64<br><br> #define SPOOFSOURCE 1<br> #define YES 1</div><div>---</div><div><br></div><div>Compiles fine!<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Juraj Lutter <<a href="mailto:otis@freebsd.org">otis@freebsd.org</a>> escreveu no dia sexta, 24/03/2023 à(s) 09:13:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> On 24 Mar 2023, at 10:09, Warner Losh <<a href="mailto:imp@bsdimp.com" target="_blank">imp@bsdimp.com</a>> wrote:<br>
> <br>
> one last reply, if this is for a port, then byteswap.h can usually be implemented as<br>
> <br>
> #include <sys/endian.h><br>
> #define __bswap_16(x) __bswap16(x)<br>
> #define __bswap_32(x) __bswap32(x)<br>
> #define __bswap_64(x) __bswap64(x)<br>
> <br>
> #define bswap_16(x) __bswap16(x)<br>
> #define bswap_32(x) __bswap32(x)<br>
> #define bswap_64(x) __bswap64(x)<br>
> <br>
> 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.<br>
<br>
In releng/13 there is also infiniband/byteswap.h that does:<br>
<br>
#include <sys/types.h><br>
#include <sys/endian.h><br>
<br>
#define bswap_16 bswap16<br>
#define bswap_32 bswap32<br>
#define bswap_64 bswap64<br>
<br>
otis<br>
<br>
—<br>
Juraj Lutter<br>
otis@FreeBSD.org<br>
<br>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><span style="color:rgb(102,102,102)">Nuno Teixeira<br>FreeBSD Committer (ports)</span></div></div>
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFDf7ULi96TAb49OW8jBO6vVOzc%2BCkNgQiDQcd-ivxKCsXsAHw>
