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

Eric Blake eblake@redhat.com
Fri Aug 13 13:17:00 GMT 2010

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>
> +

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

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20100813/73c714c5/attachment.sig>

More information about the Cygwin mailing list