From: Joaquin C. A. <e98...@fr...> - 2004-09-08 08:30:31
|
Steve Kann wrote: > > On Sep 7, 2004, at 10:01 PM, Alex Epshteyn wrote: > >> I am new to this list and trying to get up to speed. >> >> It appears that the project uses gcc (MinGV and Cygwin) to build the >> library, compiling library's wrapper wiax.dll (in diax project) is >> also done >> with gcc. >> I have seen a few questions about compiling with VC++, but not too many >> answers, and it is not obvious what has changed since these posts. >> >> Are the Microsoft VC++ project files out of date? > > > Yes. > >> I would like to build a >> dll using VC++, and wonder if that would be a relatively major effort? > > > Probably not. > >> Can >> the library be compiled with VC++ without any patches? > > > No; there's a couple of gcc-specific features that are used in the > library. I went through and cleaned most of these up, and AFAIK the > only issue left is that we use a zero-length array as the last member > of a structure; in gcc, this refers to the memory _after_ the end of > the structure, and was a neat hack that Mark did in libiax2. > > Unfortunately, nobody has come up with a similar construction that > _is_ portable to compilers which don't support this (simple) extension. The "standard" way to port this extension to compilers that don't support 0-length arrays, is to change it to a 1-length array (you can potencially waste a little bit of memory, but that's usually considered ok). That way you can still refer to the array, using the buffer as "backend". Things get more complicated if you want to access the data through the buffer instead of through the array. Can anybody show the code that uses buf to see if is it enough to change afdata to 1-length array? Cheers, |