[vorbis-dev] segfault cause found

Jonathan Blow jon at bolt-action.com
Tue Apr 18 21:59:27 PDT 2000



Michael Smith wrote:

> >The obvious fault is me using #ifdef _WIN32 in os.h.  Is, perhaps, _MSVC_ or
> >something like that a better idea?

Hi, I'm some guy who's a game developer.  What we have done on previous
projects is to have completely separate os.h files, one for each operating
system and/or compiler version, in include subdirectories named after that
system/compiler/etc.  Then the Makefile (or msvc project or whatever)
specifies the proper include path to snag that header file.

The nice thing about this is that there's absolutely no confusion about
which definition of what is being used.  Also, the header files tend to
be easier to read and understand since there are no #ifdefs.  (In fact 
we have a cross-platform game that is around 500,000 lines of code and 
I swear there are no ifdefs in there at all.  Well maybe there are 2 or 3.)

Of course that's pretty subjective, yall's mileage may vary.

   -Jonathan.

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/



More information about the Vorbis-dev mailing list