[vorbis-dev] Bug fix, win32 stuff
Michael Smith
msmith at labyrinth.net.au
Mon May 1 05:06:41 PDT 2000
At 02:48 AM 5/1/00 -0700, you wrote:
>
>A destructor must always be safe; internal inconsistency due to failure
halfway
>through a process is a bad thing. If I've made this mistake (allowing
>inconsistent data), than that's a bug and I should be docked a beer :-)
This makes sense - consider yourself docked 1 (one) beer ;)
>As much as is reasonably possible should go into the project... I'm very
>allergic to ifdefs. However, there's such a thing as too much blind dogma and
>we may end up creating too much work by insisting on no platform specific
code
>in the mainline headers or lib source.
>
>What I don't want is #ifdefs laced throughout the code. I'd also like to
>avoid ifdef trees even in reasonably well contained areas if avoidable.
>Perhaps having an (eg) os_win32.h in the lib source and a (eg) public
>public_win32.h in the include/vorbis dir is the cleanest, most transparent
way
>to do this without making things more difficult for developers on either
side
>of the APIs.
OK. We need 2 seperate things: appropriate definitions for public types,
and various internal #defines, typedefs, etc.
I think the first is best served by a single file (independent of the
platform). Perhaps vorbis_types.h? Something along those lines, anyway.
This would bring quite a few #ifdefs into this file, but they will be
relatively simple, and it's going to be unavoidable unless we have seperate
files depending on platform (which is a bad thing, for external headers).
Then, for internal headers, we have os.h - perhaps this could be changed to
have no real contents at all, just a simple set of
#ifdef platform1
#include <os_platform1.h>
#endif
Then each platform header would define anything required (other than the
public types - we can just include the public header there). Right now,
this would just be a single os_win32.h, as you suggested - others will
doubtless be added later (for example, vorbis wouldn't compile on a solaris
machine I was using a while back, since u_int* weren't defined. This would
be easily fixed by an os_unix.h, but the machine also didn't have GNU Make
on it, so I gave up - I'll get back to that some time).
This would seem to keep things fairly clear, though the number of little
files would increase a fair bit.
Michael
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
More information about the Vorbis-dev
mailing list