Re: [libtorrent] Current CVS version functional?
Brought to you by:
arvidn
|
From: Arvid N. <c9...@cs...> - 2004-03-10 09:09:41
|
Iain Heggie wrote: > It seems that the problem I was having was caused by the hash being > incorrect. I was able to track it back to sha1.c which assumes that the > architecture is little endian in all cases. Specifically, all cases in > the #ifdef assume that the macro LITTLE_ENDIAN should be defined thus > causing blk0(i) not to be correctly defined (lines 110 - 117). This is > further complicated by the fact that both LITTLE_ENDIAN and BIG_ENDIAN > are defined somewhere else, probably by one of the other included files. > > I'm currently looking into where it is defined and what the correct big > endian macro to use is so that I can put together a patch that will work > on all big endian systems. Apple's version of gcc sets __BIG_ENDIAN__ > but I haven't been able to determine if this macro is universal. > > As it stands right now, my problem is solved and I'll look into the > correct macro to use so that it can be integrated into libtorrent. > > -- > Iain Great, thank you! I don't set LITTLE_ENDIAN anywhere in the libtorrent headers. As you might have noticed, the sha1.c is not written by me, so I've just assumed that it handled big endian cases correctly. Maybe the code in that file expects me to define LITTLE_ENDIAN or BIG_ENDIAN at the start of that compilation unit. -- Arvid Norberg |