* Implement fallback OpenGL symbol loader for Linux devices with EGL < 1.5
The `eglGetProcAddress` in old versions of EGL can only get extension
functions, so we need to supplement it with another symbol loader that
can get non-extension functions.
* Close `g_egl_gl_dll` if `egl_init_context()` fails
* Close `g_egl_gl_dll` when VideoCore driver is destroyed
* Defer loading of `g_egl_gl_dll` until needed
* Fix typo in `egl_destroy_gl_dll`
* Remove redundant `ptr` variable in `egl_init_context`
* Remove redundant call to `egl_destroy_gl_dll` in `egl_init_context`
* Remove another redundant call to `egl_destroy_gl_dll` in `egl_init_context`
In gfx/drivers_context/vc_egl_ctx.c, move gfx_ctx_vc_bind_api
declaration to before it's called by any other function, otherwise it
warns about "warning: implicit declaration of function" and can error
out with "error: conflicting types for 'gfx_ctx_vc_bind_api'" in certain
cases.
Added a platform parameter to egl_init_context. If the caller provides a
platform other than EGL_NONE, then it will try to use eglGetPlatformDisplay or
eglGetPlatformDisplayEXT instead of eglGetDisplay.
If neither eglGetPlatformDisplay or eglGetPlatformDisplayEXT is supported, then
it will still fall back to calling eglGetDisplay.
Updated the Wayland, X11, and DRM callers to use the correct platform enum.
Those are the callers that don't just pass EGL_DEFAULT_DISPLAY as the native
display handle.
Calling eglGetDisplay with any value other than EGL_DEFAULT_DISPLAY is
inherently unreliable, because it requires the EGL implementation to guess a
platform type based on a (void *) pointer. Some implementations might not
identify a particular platform, or worse, might guess wrong.
Fixes https://github.com/libretro/RetroArch/issues/4790