Skip to content

Conversation

endrift
Copy link

@endrift endrift commented Apr 13, 2025

DllMain wouldn't be called if the library is statically linked, so this instead initializes it in epoxy_handle_external_wglMakeCurrent instead of DllMain if it hasn't yet been initialized. By using INIT_ONCE, this is threadsafe.

Cf. #200

return epoxy_extension_in_string(getext(hdc), ext);
}

BOOL
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this needs to be BOOl WINAPI so that it gets defined with the __stdcall calling convention rather than __cdecl

Otherwise:

error C2440: 'function': cannot convert from 'BOOL (__cdecl *)(PINIT_ONCE,PVOID,PVOID *)' to 'PINIT_ONCE_FN'
warning C4024: 'InitOnceExecuteOnce': different types for formal and actual parameter 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants