[vorbis-dev] segfault cause found

Andy Key scsiprog at hotmail.com
Wed Apr 19 00:57:01 PDT 2000



>Ah.  MSVC requires _alloca() as a synonym for *NIX alloca().  This must be 
>an
>internal function in mingw32 that I shouldn't use.

I think it's more a bug in mingw32.  Without the prototype, it just 
subtracts x bytes from the stack pointer to allocate space.  The function 
version seems to do so as well -- the stack pointer has changed upon return 
from _alloca() -- but something's not quite right in all cases.  If I have 
some more time, I'll probably look at it.

In any case, why the function doesn't work is irrelevant. :-)

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

Perhaps a configuration option, like

config.h:
#define NEED_UNDERSCORE_ALLOCA 0

os.h:
#if NEED_UNDERSCORE_ALLOCA
#  define alloca(x) (_alloca(x))
#endif

Each OS/compiler could have its own config.h -- it would be easier than 
trying to find what symbols have to be #define'd by different compilers.

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

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



More information about the Vorbis-dev mailing list