NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Building NetBSD under cygwin



On Sat, 16 Feb 2008, a4a5jt%gmail.com@localhost wrote:
> Obviously this happens because the function is declared in
> src/sys/sys/sha1.h as:
> 
> void      SHA1Transform(uint32_t[5], const u_char[64]);
> 
> and defined in src/common/lib/libc/hash/sha/sha1.c as:
> 
> void SHA1Transform(state, buffer)
>     u_int32_t state[5];
>     const u_char buffer[64];

That's a bug; NetBSD should be using uint32_t in both places.  This
should be fixed in revision 1.3 of common/lib/libc/hash/sha1/sha1.c.

> Cygwin define uint32_t and u_int32_t as long and int respectively:
> 
> typedef __uint32_t u_int32_t;           //      # 140 
> "/usr/include/cygwin/types.h"
> typedef unsigned long uint32_t;         //      # 18 "/usr/include/stdint.h"
> typedef unsigned int __uint32_t;        //      # 58 
> "/usr/include/machine/_types.h"

That's rather weird, even if int and long are both 32 bit types under Cygwin.

--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index