This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: diff /usr/include/endian.orig.h /usr/include/endian.h > endian.h.diff


On 08/12/2010 06:35 PM, Pedro Izecksohn wrote:
> --- I wrote:
>> Defines macros for to convert the endianness of 16, 32 and 64 bits
>> integer types.
>>
>> diff -c /usr/include/endian.orig.h /usr/include/endian.h
> 
> My previous diff is wrong. The right one follows:

OK, that documents _what_ your changes are, but not _why_ you are making
them.  Mentioning that you are adding macros that are present in a Linux
installation's endian.h would have been nice (for example, that you made
your changes by reading 'man htobe16' on Linux).

> + #ifdef _BSD_SOURCE
> +
> + #include <byteswap.h>
> +
> + #if __BYTE_ORDER == __LITTLE_ENDIAN

Umm - did you copy straight from glibc's endian.h?  That's a no-no;
cygwin generally doesn't want to borrow LGPL sources to avoid any
licensing questions (borrowing from BSD is okay, on the other hand).
You would have to implement things from scratch from a documentation
page, or copy from a less-questionable source, rather than using glibc's
implementation.

I'm stopping right here, so I don't risk tainting myself.  How about you
instead describe which macros you are missing, so someone can do a
clean-room implementation of those macros.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]