From: Darren S. <da...@st...> - 2004-01-02 21:21:28
|
Hi Faizan et al There are still errors it seems :-( In libiax2/iax-client.h: typedef int PASCAL (*sendto_t)(SOCKET, const char *, int, int, const struct sockaddr *, int); Doesn't seem to work at all, if I remove the PASCAL (google says PASCAL == __stdcall?) it compiles however WinIAX crashes badly, yet no matter what combination I try, will it accept it :-) In iax.c 'struct iax_session *iax_session_new(void)': S->sendto = sendto causes: error C2152: '=' : pointers to functions with different attributes If I typecast it with (sendto_t) it compiles? Lastly, but I don't think it matters too much (except from a performance point of view?): Libiax2/winpoop.h: inline doesn't seem to want to work, either as __inline or inline. Any thoughts you have would be appreciated. Regards Darren ']data[' Smith. > -----Original Message----- > From: iax...@li... > [mailto:iax...@li...] On > Behalf Of Faizan Naqvi > Sent: 23 November 2003 07:52 > To: iax...@li... > Subject: [Iaxclient-devel] solved struct hell. > > 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=0; > unsigned int lastsent; > unsigned int fts; > > #ifdef _MSC_VER > buffer[0]=0; > #else > /* Shut up GCC */ > buf.buffer[0] = 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. > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign > up for IBM's Free Linux Tutorials. Learn everything from the > bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > Iaxclient-devel mailing list > Iax...@li... > https://lists.sourceforge.net/lists/listinfo/iaxclient-devel > |