On 28 May 2012 12:47, Jan Kiszka <jan.kis...@web.de> wrote:
> On 2012-05-28 00:10, Peter Maydell wrote:
>> On 27 May 2012 17:42, Andreas Färber <andreas.faer...@web.de> wrote:
>>> +# if defined(__APPLE__)
>>> +#  undef NTOHL
>>> +#  undef NTOHS
>>> +#  undef HTONL
>>> +#  undef HTONS
>>> +#  define NTOHL(d) do { } while (0)
>>> +#  define NTOHS(d) do { } while (0)
>>> +#  define HTONL(d) do { } while (0)
>>> +#  define HTONS(d) do { } while (0)
>>> +# else
>>
>> We could just use this for everything, not just if __APPLE__,
>> right? For big-endian the semantics we want are always "do
>> nothing" so it's always OK to undef and redefine...
>> That would save having a special case.
>
> Yes, please.

It occurred to me that you could also have the unconditional
#undefs outside the #ifdef HOST_WORDS_BIGENDIAN, but that
is starting to stray outside of the "simple fix for 1.1"
territory.

-- PMM

Reply via email to