From: Babar S. <bab...@ya...> - 2003-12-30 10:32:44
|
Hi Steve Kann, > 2) Second, I applied changes to address the Win32 build issues outlined > in the patch that Babar submitted on 19 December (Thanks, Babar!). The > changes I applied weren't exactly as he had them in the patch, but I > think that I addressed each of the issues, with one exception. Going > through them: > > a) sendto type mismatch: I made an alternate declaration of sendto_t > which I believe should match the Win32 header declaration better. [this > is a proper fix, instead of casting to int]. #ifdef WIN32 typedef int PASCAL (*sendto_t)(SOCKET, const char *, int, int, const struct sockaddr *, int); #else typedef int (*sendto_t)(int, const void *, size_t, int, const struct sockaddr *, socklen_t); #endif I also tried the same thing before (as i sent you email regarding this) but MSVC complain about difference in attributes(Error). > b) His change to the order of elements in struct { } buf inside of > iax.c: I think that this change is _incorrect_. Can someone who knows > MSVC help out with this? I did not apply this. Here's the relevant > section from his diff: > > 616,619d615 > < struct { > < struct iax_frame fr2; > < unsigned char buffer[4096]; /* Buffer -- must preceed fr2 */ > < } buf; > 620a617,620 > > > >> struct { > >> unsigned char buffer[4096]; /* Buffer -- must preceed fr2 */ > >> struct iax_frame fr2; > >> } buf; MSVC is not allowing to use array (empty or zero length array error) after struct in a struct. struct { unsigned char buffer[4096]; /* Buffer -- must preceed fr2 */ struct iax_frame fr2; } buf; May be some other way to do this !! > c) __FUNCTION__ not defined in MSVC: Only used __FUNCTION__ is __GNUC__ > is defined. (maybe I could have just done ifdef __FUNCTION__ there? MSVC doesn't support __FUNCTION__ . We can use __FILE__ if required. > f) inline define. You used inline instead of INLINE static int INLINE inet_aton(char *cp, struct in_addr *inp) is ok. All other things specially pragma pack are working fine for MSVC. Regards, Babar Shafiq Nazmi. --- Steve Kann <st...@st...> wrote: > > I've applied a few patches to the library: > > 1) First, I applied the two patches that SteveU sent to me, as they were > delivered. Thanks so much, Steve. I'm thinking it's highly likely this > will fix the problems that people have been reporting on the asterisk > mailing list (but not here too much), where: > a) asterisk is timing out live calls, because of ping timeouts (the > pings were a bit late, and were getting > dropped). > b) The client was missing incoming calls at times. > > > 2) Second, I applied changes to address the Win32 build issues outlined > in the patch that Babar submitted on 19 December (Thanks, Babar!). The > changes I applied weren't exactly as he had them in the patch, but I > think that I addressed each of the issues, with one exception. Going > through them: > > a) sendto type mismatch: I made an alternate declaration of sendto_t > which I believe should match the Win32 header declaration better. [this > is a proper fix, instead of casting to int]. > > b) His change to the order of elements in struct { } buf inside of > iax.c: I think that this change is _incorrect_. Can someone who knows > MSVC help out with this? I did not apply this. Here's the relevant > section from his diff: > > 616,619d615 > < struct { > < struct iax_frame fr2; > < unsigned char buffer[4096]; /* Buffer -- must preceed fr2 */ > < } buf; > 620a617,620 > > > >> struct { > >> unsigned char buffer[4096]; /* Buffer -- must preceed fr2 */ > >> struct iax_frame fr2; > >> } buf; > > > > > Basically, this is all Mark's doing :) What mark is trying to do is > allocate an extra 4K past the end of fr2, so that we can use the > zero-length afdata member at the end of the frame with 4k of room. MSVC > complains here at the declaration stage. > > > c) __FUNCTION__ not defined in MSVC: Only used __FUNCTION__ is __GNUC__ > is defined. (maybe I could have just done ifdef __FUNCTION__ there? > > d) #define snprintf to _snprintf.. > > e) structure packing stuff. Did basically the same thing, but without > totally repeating all the declarations. Just surrounded them with > appropriate preprocessor-fu to make both MSVC and GNUC happy. > > f) inline define. > > g) add time.h to iaxclient_lib.h, instead of just to winfuncs.h > > I've only tested this by compiling here on Linux so far. If someone > could be so kind as to try this out on Win32 and especially with MSVC. > > -SteveK > > ===== God is a great Programmer __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree |