FS#9717 - Fix "warning: "htobe16" redefined"

Attached to Project: Rockbox
Opened by Akio Idehara (idak) - Friday, 26 December 2008, 22:34 GMT
Last edited by Nils Wallménius (nls) - Saturday, 24 January 2009, 10:17 GMT
Task Type Patches
Category Simulator
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


I think newer? SDL includes <endian.h>
(my fedora10's SDL version is 1.2.13),
and simulator build log says like the following.
warning: "htobe16" redefined
This patch fix it.
This task depends upon

Closed by  Nils Wallménius (nls)
Saturday, 24 January 2009, 10:17 GMT
Reason for closing:  Accepted
Additional comments about closing:  Committed with funman's suggested change, thanks!
Comment by Rafaël Carré (funman) - Thursday, 08 January 2009, 07:06 GMT
You don't need to check if a symbol is defined before undefining it, simply use "#undef xxx"

However I think sdl.h should be checked to see if some macro can prevent inclusion of endian.h
Comment by Michael Sevakis (MikeS) - Thursday, 08 January 2009, 11:44 GMT
I think '#define _ENDIAN_H' somewhere before including headers would prevent it (as a -D_ENDIAN_H perhaps).
Comment by Akio Idehara (idak) - Thursday, 08 January 2009, 14:40 GMT
I think -D_ENDIAN_H is not good, because endian.h defines other thins like "__BYTE_ORDER".
And if it doesn't defined, a lot of error is printed.

Comment by Rafaël Carré (funman) - Friday, 09 January 2009, 23:17 GMT
If it's enclosed into #ifdef SIMULATOR (because only the sim use SDL) I think this should be good.

Michael what do you think ?