]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sys/_endian.h: Move powerpc workaround into _endian.h
authorWarner Losh <imp@FreeBSD.org>
Tue, 14 Feb 2023 17:48:05 +0000 (10:48 -0700)
committerWarner Losh <imp@FreeBSD.org>
Tue, 14 Feb 2023 17:51:21 +0000 (10:51 -0700)
commit6f23df1ae7f6ec3cd06a15c87f0aaaa770b2941b
tree161fa414bdb8785dcb34135e864d96a12f4666ce
parent50fce3b4b070a9eb59d7988da8b3356c4cf26b26
sys/_endian.h: Move powerpc workaround into _endian.h

Powerpc compilers often define _BIG_ENDIAN or _LITTLE_ENDIAN depending
on the byte order of the target. This interfers with the endian.h and
sys/endian.h APIs which expect those two to be 4321 or 1234.
Unconditionally undefine these two before we define them to work around
this issue. By including endian.h, the programmer is saying they want
this API not the native one. This matches historic practice as well.

Fixes: e35448a901aa
Sponsored by: Netflix
Noticed by: powerpc, powerpc64 CI jobs
sys/sys/_endian.h