We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5441

Summary: Add support for endianness check on FreeBSD: Fixes endianness checking on at least powerpc64le, maybe also other architectures
Product: SDL Reporter: VVD <vvd>
Component: *don't know*Assignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sezeroz
Version: 2.0.14   
Hardware: All   
OS: FreeBSD   
Attachments: Add support for endianness check on FreeBSD

Description VVD 2021-01-03 07:36:41 UTC
Created attachment 4634 [details]
Add support for endianness check on FreeBSD

Patch based on patch from FreeBSD port devel/sdl20:
https://svnweb.freebsd.org/ports/head/devel/sdl20/files/patch-include_SDL__endian.h?view=log
Comment 1 Sam Lantinga 2021-01-03 18:20:28 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/240db31a2e01
Comment 2 VVD 2021-01-04 04:33:29 UTC
Thanks!
Comment 3 Ozkan Sezer 2021-01-04 06:05:45 UTC
Is sys/endian.h the new way to do it?  I've been using
machine/endian.h for quite some time.
Comment 4 VVD 2021-01-04 07:16:27 UTC
(In reply to Ozkan Sezer from comment #3)
> Is sys/endian.h the new way to do it?  I've been using
> machine/endian.h for quite some time.

sys/endian.h is the correct way, but machine/endian.h in most cases will work too:
$ grep machine/endian.h /usr/include/sys/endian.h 
#include <machine/endian.h>

https://svnweb.freebsd.org/base/head/sys/sys/endian.h?view=markup
Comment 5 Ozkan Sezer 2021-01-04 07:25:44 UTC
(In reply to VVD from comment #4)
> sys/endian.h is the correct way, but machine/endian.h in most cases will
> work too:
> $ grep machine/endian.h /usr/include/sys/endian.h 
> #include <machine/endian.h>
> 
> https://svnweb.freebsd.org/base/head/sys/sys/endian.h?view=markup

I see, thanks.  So it's been there since 2002.