Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Mar 2023 10:13:24 +0100
From:      Juraj Lutter <otis@FreeBSD.org>
To:        Warner Losh <imp@bsdimp.com>
Cc:        Yuri <yuri@aetern.org>, Nuno Teixeira <eduardo@freebsd.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:  <13BBF767-6CBB-41D5-AD93-6ADD9C417811@FreeBSD.org>
In-Reply-To: <CANCZdfq2nLt1Bq2Jzn=ivvqaOvF9=y8j=ChZzy6TrE5zAzeFiw@mail.gmail.com>
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>

next in thread | previous in thread | raw e-mail | index | archive | help


> On 24 Mar 2023, at 10:09, Warner Losh <imp@bsdimp.com> wrote:
>=20
> one last reply, if this is for a port, then byteswap.h can usually be =
implemented as
>=20
> #include <sys/endian.h>
> #define __bswap_16(x) __bswap16(x)
> #define __bswap_32(x) __bswap32(x)
> #define __bswap_64(x) __bswap64(x)
>=20
> #define bswap_16(x) __bswap16(x)
> #define bswap_32(x) __bswap32(x)
> #define bswap_64(x) __bswap64(x)
>=20
> 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

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?13BBF767-6CBB-41D5-AD93-6ADD9C417811>