You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The functions are now provided by most *nix/BSD systems through endian.h or sys/endian.h, no need to define them on systems other than Windows or Mac.
Provided through endian.h: Linux (probably GNU/Hurd too), OpenBSD (according to manpage), Cygwin and MSYS2 (looked up the headers on GH), Haiku (tested in VM), IllumOS (manpage; probably Solaris too)
Provided through sys/endian.h: FreeBSD (manpage; probably on DragonFlyBSD too), NetBSD (manpage)
You should also add checks for HAVE_ENDIAN_H and HAVE_SYS_ENDIAN_H.
To support MSVC you need to replace the __builtin_bswap* functions with _byteswap_u* from stdlib.h, and also include sys/param.h only on MinGW. MSVC doesn't seem to set a macro for byte order, so you have to set it manually to little endian if nothing was specified by the user or a configure script.
I was looking up things and tested some stuff.
The functions are now provided by most *nix/BSD systems through endian.h or sys/endian.h, no need to define them on systems other than Windows or Mac.
Provided through
endian.h
: Linux (probably GNU/Hurd too), OpenBSD (according to manpage), Cygwin and MSYS2 (looked up the headers on GH), Haiku (tested in VM), IllumOS (manpage; probably Solaris too)Provided through
sys/endian.h
: FreeBSD (manpage; probably on DragonFlyBSD too), NetBSD (manpage)You should also add checks for
HAVE_ENDIAN_H
andHAVE_SYS_ENDIAN_H
.To support MSVC you need to replace the
__builtin_bswap*
functions with_byteswap_u*
from stdlib.h, and also includesys/param.h
only on MinGW. MSVC doesn't seem to set a macro for byte order, so you have to set it manually to little endian if nothing was specified by the user or a configure script.Here's how I would do this:
The text was updated successfully, but these errors were encountered: