2009/3/13 Della Betta Filippo <filippo.dellabe...@telecomitalia.it>:
>>Hm, wonder what was the reason to drop the extern in first place?
>
> What do you mean ? Sorry I don't get it :(

At some point in Sofia history, there was extern there. But it has
been removed, and I wonder (aloud) why.

>>>generated defining HAVE_GAI_STRERROR to 1
>
>>You could have a peek in config.log and see config.log which
>>diagnostics the gcc spews out there.
>
> Attached the program that configure generates to detect gai_strerror. For 
> mingw gai_strerror is defined inline in header <ws2tcpip.h>

Thanks.

>>There is also some problems with thread-specific storage in
>>su_uniqueid.c. Currently, I plan to solve the issue with pthread_once,
>>pthread_key and a cleanup function declared with GCC
>>__attribute__((destructor)) on Unix systems. I plan to call the
>>destructor fucntion from a DllMain() function in win32/64, but perhaps
>>someone more familiar with mingw could tell me how mingw gcc and
>>runtime implements __attribute__((destructor)) and what happens if
>>sofia-sip has defined its own DllMain()?
>
> I saw :( thread is ignored by mingw...What do you mean by "has defined its 
> own DllMain()" ? If you don't write it, it doesn't have it..

I've always thought that the function called by Windows dynamic loader
would be DllMain. D'oh. This seems to be a bit more complicated.

Quick googling revealed that normally C runtime includes its own
initialization code in DLLs as DllMainCRTStartup() and this
initialization code invokes constructors, prepares for destructors and
then calls DllMain:

<http://support.microsoft.com/kb/94248>
<http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/mingw/dllcrt1.c?rev=1.4&cvsroot=src>

(looks like _pei386_runtime_relocator() is the thing that I've been
missing all these years. Damn MS. Damn DllMainCRTStartup()).

This looks like the way to implement __attribute__((destructor)) with MSVC:

<http://www.codeguru.com/cpp/misc/misc/threadsprocesses/article.php/c6945>

--
Pekka.Pessi mail at nokia.com

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to