From: Faizan N. <fai...@vo...> - 2004-01-02 17:52:57
|
Hi. Well it looks like Release version wont work for a while. So here is the solution with some C theory. If I am repeating someone's else thoughts than sorry for that. /////////////////MY CODE////////////////// #ifdef _MSC_VER unsigned buffer[4096]; struct { struct iax_frame fr2; } buf; #else struct { struct iax_frame fr2; unsigned char buffer[4096]; /* Buffer -- must preceed fr2 = */ } buf; #endif struct iax_frame *fr; int res; int sendmini=3D0; unsigned int lastsent; unsigned int fts; #ifdef _MSC_VER buffer[0]=3D0; #else /* Shut up GCC */ buf.buffer[0] =3D 0; #endif /////////////////////////////////////////END OF MY CODE.////////////////////////////// The member afdata of iax_frame is zero sized. The struct hell origianly = was declaerd like this ////////////////code in iax_send///////// struct hell { struct iax_frame*fr2; unsigned char buffer[4096]; } buf; ////////////////end code/////// This allocated 4K after afdata so when afdata is filled it goes into = buffer but is able to accessed by afdata. MSVC doesnt allow this. Putting it buffer before fr2 compiles fine but = gives no space for data to be copied in afdata. So, remebering that stack is in reverse declaring buffer just before = struct hell gives afdata 4K like this. //////////////modified iax_send code./////////// unsigned char buffer[4096]; struct hell { struct iax_frame*fr2; } buf; //////////////end code/////////////////////// I hope this solevs the proble, Somebody get the Release version working. thank you. |