[Mesa-dev] [PATCH 3/5] compiler: define endian for FreeBSD

Emil Velikov emil.l.velikov at gmail.com
Thu Oct 26 14:07:46 UTC 2017


On 23 October 2017 at 21:20, Greg V <greg at unrelenting.technology> wrote:
> Obtained from: FreeBSD ports
> ---
>  src/mesa/main/compiler.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h
> index 43a06b4313..8652aac36c 100644
> --- a/src/mesa/main/compiler.h
> +++ b/src/mesa/main/compiler.h
> @@ -51,6 +51,9 @@
>  #if defined(__linux__)
>  #include <byteswap.h>
>  #define CPU_TO_LE32( x )       bswap_32( x )
> +#elif defined(__FreeBSD__)
> +#include <sys/endian.h>
> +#define CPU_TO_LE32( x )       bswap32( x )
Isn't this handled by the #else further down?

#if defined(__linux__)
...
#elif defined(__APPLE__)
...
#elif defined(__OpenBSD__)
...
#else /*__linux__ */
#include <sys/endian.h>
#define CPU_TO_LE32( x )        bswap32( x )
#endif /*__linux__*/

So unless FreeBSD defines __APPLE__ or __OpenBSD__ things should work
w/o the patch?

-Emil


More information about the mesa-dev mailing list