Re: [94] [Libbt-devel] Re: Need some "other than Mac" checking done "PopperAndShadow"
Brought to you by:
ksmathers
From: <ke...@an...> - 2005-05-13 20:27:35
|
Hi Dakidd, > Op donderdag 5 mei 2005 23:38, schreef Dakidd: > > Hey guy... > > I think I've managed to knock the kinks out of util.c/util.h for use on > > Macs. I need somebody who can compile for Windows/Unix to check it out and > > see if I screwed up and trashed things for those platforms, or if my > > surgery managed to fix the Mac troubles, yet still leave the "other > > platforms" functional. > > > > The most obvious change (aside from "prettifying" the code - No offense > > intended against Kevin, but he writes code that, in my opinion, is all but > > completely unreadable) is that cacheopen() now takes a void * rather than a > > char * as its first parameter - I *THINK* I've included the right "magic" > > to make this transparent, but I haven't got a way to test that theory. If > > you're wondering about the reason for this, it's kinda in-depth and a pain > > to explain, but I can give you the 411 if you really think it's needed. The > > short version: Macs are *MUCH* happier dealing with files when they're > > passed around as an FSSpec rather than pathnames. There's a lot of voodoo > > involved, but it boils down to "if you want it to work properly in all > > situations on a Mac, do it with FSSPec structs instead of pathnames, > > otherwise, expect to hear your users screaming at you about meltdowns that > > happen for no apparent reason." If you are having trouble with code formatting then you probably need to set physical tabs to 8 columns in your editor. > > > > I've done my best to conditionalize my changes (on the "TARGET_MACOS" > > value, set up in config.h) so that Unix/Windows can continue passing in a > > char * with a fully-qualified pathname and never notice a difference, while > > Macs will pass in an FSSpec, but have no way to test the Unix/Windows > > functionality. > > Send me your patches and I'll take a look. -- Look ma, no threads[1]. [1] BitTorrent in C is http://www.sf.net/projects/libbt // .--=, .....::://::::::::::::::::::::::::::::.. (o O & ke...@an... :::::::://:::://://://:/:://::||_// / V K :::::://:::://:/:|//'/' // _,|' r , 'qk :'''/____ // / // |_// // || .'~. .~`, kls \_/-=\_/ |