On 14-Aug-06, 17:32 (CDT), Hendrik Sattler <[EMAIL PROTECTED]> wrote: > Am Montag 14 August 2006 23:27 schrieb Steve Greenland: > > The *real* problem with the whole autotools disaster is that it promotes > > a braindead idea of how to achieve portability: a #ifdef branch for > > every different system (or library version, or whatever), strewn > > throughout the entire codebase. > > Even when looking at somewhat related systems like *BSD and Linux, even > opening an bluetooth RFComm socket _must_ use #ifdefs because this small OSS > community cannot communicate about simple stuff like: > - placing the bluetooth.h header file > - naming values in the headerfile > - names of the address structure and its elements.
No, you don't #ifdef all the users, you write multiple versions of a a generic function that hides the differences, and compile the appropriate one. Read the reference I gave. Sure, you *could* do this with autoconf driving the compilation, but nobody ever does. They just write a spaghettied mess in the main body of the code, like the examples. > > Real portability involves understanding > > your target systems, learning where the rough edges and corner cases > > are, and developing proper abstractions to work around them. > > Real life portability is often done for systems that you > - did not install yourself > - do not have steady access to or no access at all (only using documentation) > or is done by people that somehow hacked into your peace of software to make > it work in their systems (with absolutely no design goal in mind while > porting). Absolutely. But that doesn't justify crap code. The whole autoconf system encourages minor patches and nasty #ifdefs rather than factoring out what's different from what's the same. Steve -- Steve Greenland The irony is that Bill Gates claims to be making a stable operating system and Linus Torvalds claims to be trying to take over the world. -- seen on the net -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]