mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] OpenAL: applications and test programs crash


From: Martin Lambers
Subject: Re: [Mingw-cross-env-list] OpenAL: applications and test programs crash
Date: Sun, 28 Nov 2010 11:33:26 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6

Hi Volker!

On 27/11/10 21:23, Volker Grabsch wrote:
> Mark Brand <address@hidden> schrieb:
>>> I found the problem. OpenAL has initialization and deinitialization
>>> functions alc_init() and alc_deinit(), defined in Alc/ALc.c. On Windows,
>>> these are called via automatic execution of DllMain by default. In our
>>> case, we have to use the gcc constructor/destructor attributes instead,
>>> like non-Windows platforms do.
>>>
>>> The attached patch makes this change by augmenting the
>>> openal-1-fixes.patch file.
>>>
>>
>> Committed. Thanks.
>>
>> http://hg.savannah.gnu.org/hgweb/mingw-cross-env/rev/df02f966cc6f
> 
> Sorry for nitpicking, and please yell at me if I'm work, but ...
> 
> 1) Doesn't this patch disable all thread safety in OpenAL?
> 
>    I'm asking because the patch does not only remove the DllMain()
>    stuff, but also the GCC constructor/destructor attributes ...
> 
> 2) Shouldn't we add the calls to alc_init() and alc_deinit()
>    to the test program, as those won't be called automatically
>    anymore?

I think there's a misunderstanding here. The attributes are still used,
and thus alc_init() and alc_deinit() are called automatically. The patch
only removes the '#ifdef HAVE_GCC_DESTRUCTOR' check and thus uses the
attributes unconditionally. As far as I can see, the check is not
performed on Windows systems and thus the attributes would not be used
otherwise.

> 3) Is it possible to formulate the patch in a portable way,
>    so we can contribute this fix to upsteam?

Yes, maybe. I'll look into this and see if upstream is interested.
Static libraries on other systems are already supported, so all that's
required is one additional option for Windows systems.

Martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]