RFC: dsound: Add support for enumerating capture devices through openal, try 4

Ken Thomases ken at codeweavers.com
Wed Dec 2 18:27:33 CST 2009


On Dec 2, 2009, at 12:11 PM, Maarten Lankhorst wrote:

> This patch doesn't apply, just a rfc email to see if this approach  
> is correct :)

> +static void *openal_handle = RTLD_DEFAULT;

> +#ifdef SONAME_LIBOPENAL
> +    char error[128];
> +    openal_handle = wine_dlopen(SONAME_LIBOPENAL, RTLD_NOW, error,  
> sizeof(error));
> +    if (!openal_handle)
> +        ERR("Couldn't load " SONAME_LIBOPENAL ": %s\n", error);
> +#endif
> +#define LOAD_FUNCPTR(f) \
> +    if((p##f = wine_dlsym(openal_handle, #f, NULL, 0)) == NULL) { \
> +        ERR("Couldn't lookup %s in libopenal\n", #f); \
> +        failed = 1; \
> +    }
> +
> +    LOAD_FUNCPTR(alcCreateContext);

By defaulting to RTLD_DEFAULT on the Mac (where SONAME_LIBOPENAL won't  
be defined), is there any risk that wine_dlsym will find the symbols  
from Wine's openal32.dll.so rather than the linked OpenAL framework?   
If it does, is that a problem?

I had proposed using RTLD_NEXT for the default to avoid that  
possibility, although it seems that RTLD_NEXT isn't universally  
available.  We might use RTLD_NEXT if it's defined and RTLD_DEFAULT  
otherwise.

-Ken




More information about the wine-devel mailing list