On Fri, 2 Nov 2001, Dan Sugalski wrote: > At 11:40 AM 11/2/2001 -0500, Andy Dougherty wrote: > >What specifically do you expect might end up in linux.[hc] as opposed to, > >say, solaris.[hc]? How many different *bsd.[ch] files do you propose? How > >many different System V.4-derived platform files do you propose? > > That's a very good question. > > Okay, here's the updated scheme. > > *) There is a platform/generic.c and platform/generic.h. (OK, it'll > probably really be unixy, but these days it's close enough) If there is no > pltform-specific file, this is the one that gets copied to platform.c and > platform.h > > *) If there *is* a platform specific file it may, and probably should > unless it plans on overriding everything, include generic.c and generic.h. > > *) All entries in generic.c should be bracketed with "#if > !defined(OVERRIDE_funcname)" and any functions that the platform defines > that override one in generic.c should have a corresponding #define > OVERRIDE_function in the platform-specific .h file > > Yeah, this is definitely a pain. If someone's got a better idea I'm all ears...
Sounds like less of a pain and more forward-looking than maintaining dozens of nearly-identical unixy platform files. Looks like a good plan to me. Portability's a pain no matter how you slice it. It's just a hard problem. I don't think there's an easy solution. -- Andy Dougherty [EMAIL PROTECTED] Dept. of Physics Lafayette College, Easton PA 18042