瀏覽代碼

Improve support for private platforms (#11220)

Caleb Cornett 9 月之前
父節點
當前提交
9af5ffcfbe

+ 2 - 2
CMakeLists.txt

@@ -966,8 +966,8 @@ if(SDL_LIBC)
     bcopy
     bcopy
     calloc ceil ceilf copysign copysignf cos cosf
     calloc ceil ceilf copysign copysignf cos cosf
     _Exit exp expf
     _Exit exp expf
-    fabs fabsf floor floorf fmod fmodf fopen64 free fseeko fseeko64
-    getenv
+    fabs fabsf fdatasync floor floorf fmod fmodf fopen64 free fseeko fseeko64
+    getenv gethostname
     _i64toa index itoa
     _i64toa index itoa
     log log10 log10f logf lround lroundf _ltoa
     log log10 log10f logf lround lroundf _ltoa
     malloc memcmp memcpy memmove memset modf modff
     malloc memcmp memcpy memmove memset modf modff

+ 6 - 0
include/SDL3/SDL_events.h

@@ -229,6 +229,12 @@ typedef enum SDL_EventType
     SDL_EVENT_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */
     SDL_EVENT_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */
     SDL_EVENT_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */
     SDL_EVENT_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */
 
 
+    /* Reserved events for private platforms */
+    SDL_EVENT_PRIVATE0 = 0x4000,
+    SDL_EVENT_PRIVATE1,
+    SDL_EVENT_PRIVATE2,
+    SDL_EVENT_PRIVATE3,
+
     /* Internal events */
     /* Internal events */
     SDL_EVENT_POLL_SENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */
     SDL_EVENT_POLL_SENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */
 
 

+ 5 - 1
include/SDL3/SDL_main.h

@@ -49,7 +49,11 @@
 #include <SDL3/SDL_events.h>
 #include <SDL3/SDL_events.h>
 
 
 #ifndef SDL_MAIN_HANDLED
 #ifndef SDL_MAIN_HANDLED
-    #ifdef SDL_PLATFORM_WIN32
+    #if defined(SDL_PLATFORM_PRIVATE_MAIN)
+        /* Private platforms may have their own ideas about entry points. */
+        #include "SDL_main_private.h"
+
+    #elif defined(SDL_PLATFORM_WIN32)
         /* On Windows SDL provides WinMain(), which parses the command line and passes
         /* On Windows SDL provides WinMain(), which parses the command line and passes
            the arguments to your main function.
            the arguments to your main function.
 
 

+ 5 - 1
include/SDL3/SDL_main_impl.h

@@ -68,7 +68,11 @@
        unless the real entry point needs to be somewhere else entirely, like Android where it's in Java code */
        unless the real entry point needs to be somewhere else entirely, like Android where it's in Java code */
     #if (!defined(SDL_MAIN_USE_CALLBACKS) || defined(SDL_MAIN_CALLBACK_STANDARD)) && !defined(SDL_MAIN_EXPORTED)
     #if (!defined(SDL_MAIN_USE_CALLBACKS) || defined(SDL_MAIN_CALLBACK_STANDARD)) && !defined(SDL_MAIN_EXPORTED)
 
 
-        #if defined(SDL_PLATFORM_WINDOWS)
+        #if defined(SDL_PLATFORM_PRIVATE_MAIN)
+            /* Private platforms may have their own ideas about entry points. */
+            #include "SDL_main_impl_private.h"
+
+        #elif defined(SDL_PLATFORM_WINDOWS)
 
 
             /* these defines/typedefs are needed for the WinMain() definition */
             /* these defines/typedefs are needed for the WinMain() definition */
             #ifndef WINAPI
             #ifndef WINAPI

+ 3 - 1
include/build_config/SDL_build_config.h

@@ -31,7 +31,9 @@
  */
  */
 
 
 /* Add any platform that doesn't build using the configure system. */
 /* Add any platform that doesn't build using the configure system. */
-#if defined(SDL_PLATFORM_WIN32)
+#if defined(SDL_PLATFORM_PRIVATE)
+#include "SDL_build_config_private.h"
+#elif defined(SDL_PLATFORM_WIN32)
 #include "SDL_build_config_windows.h"
 #include "SDL_build_config_windows.h"
 #elif defined(SDL_PLATFORM_WINGDK)
 #elif defined(SDL_PLATFORM_WINGDK)
 #include "SDL_build_config_wingdk.h"
 #include "SDL_build_config_wingdk.h"

+ 2 - 0
include/build_config/SDL_build_config.h.cmake

@@ -75,8 +75,10 @@
 #cmakedefine HAVE_MALLOC 1
 #cmakedefine HAVE_MALLOC 1
 #cmakedefine HAVE_CALLOC 1
 #cmakedefine HAVE_CALLOC 1
 #cmakedefine HAVE_REALLOC 1
 #cmakedefine HAVE_REALLOC 1
+#cmakedefine HAVE_FDATASYNC 1
 #cmakedefine HAVE_FREE 1
 #cmakedefine HAVE_FREE 1
 #cmakedefine HAVE_GETENV 1
 #cmakedefine HAVE_GETENV 1
+#cmakedefine HAVE_GETHOSTNAME 1
 #cmakedefine HAVE_SETENV 1
 #cmakedefine HAVE_SETENV 1
 #cmakedefine HAVE_PUTENV 1
 #cmakedefine HAVE_PUTENV 1
 #cmakedefine HAVE_UNSETENV 1
 #cmakedefine HAVE_UNSETENV 1

+ 2 - 0
include/build_config/SDL_build_config_android.h

@@ -57,8 +57,10 @@
 #define HAVE_MALLOC 1
 #define HAVE_MALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_REALLOC    1
 #define HAVE_REALLOC    1
+#define HAVE_FDATASYNC 1
 #define HAVE_FREE   1
 #define HAVE_FREE   1
 #define HAVE_GETENV 1
 #define HAVE_GETENV 1
+#define HAVE_GETHOSTNAME 1
 #define HAVE_PUTENV 1
 #define HAVE_PUTENV 1
 #define HAVE_SETENV 1
 #define HAVE_SETENV 1
 #define HAVE_UNSETENV   1
 #define HAVE_UNSETENV   1

+ 2 - 0
include/build_config/SDL_build_config_emscripten.h

@@ -60,8 +60,10 @@
 #define HAVE_MALLOC 1
 #define HAVE_MALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_REALLOC 1
 #define HAVE_REALLOC 1
+#define HAVE_FDATASYNC 1
 #define HAVE_FREE 1
 #define HAVE_FREE 1
 #define HAVE_GETENV 1
 #define HAVE_GETENV 1
+#define HAVE_GETHOSTNAME 1
 #define HAVE_SETENV 1
 #define HAVE_SETENV 1
 #define HAVE_PUTENV 1
 #define HAVE_PUTENV 1
 #define HAVE_UNSETENV 1
 #define HAVE_UNSETENV 1

+ 2 - 0
include/build_config/SDL_build_config_ios.h

@@ -49,8 +49,10 @@
 #define HAVE_MALLOC 1
 #define HAVE_MALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_REALLOC    1
 #define HAVE_REALLOC    1
+#define HAVE_FDATASYNC 1
 #define HAVE_FREE   1
 #define HAVE_FREE   1
 #define HAVE_GETENV 1
 #define HAVE_GETENV 1
+#define HAVE_GETHOSTNAME 1
 #define HAVE_PUTENV 1
 #define HAVE_PUTENV 1
 #define HAVE_SETENV 1
 #define HAVE_SETENV 1
 #define HAVE_UNSETENV   1
 #define HAVE_UNSETENV   1

+ 2 - 0
include/build_config/SDL_build_config_macos.h

@@ -54,8 +54,10 @@
 #define HAVE_MALLOC 1
 #define HAVE_MALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_REALLOC    1
 #define HAVE_REALLOC    1
+#define HAVE_FDATASYNC 1
 #define HAVE_FREE   1
 #define HAVE_FREE   1
 #define HAVE_GETENV 1
 #define HAVE_GETENV 1
+#define HAVE_GETHOSTNAME 1
 #define HAVE_SETENV 1
 #define HAVE_SETENV 1
 #define HAVE_PUTENV 1
 #define HAVE_PUTENV 1
 #define HAVE_UNSETENV   1
 #define HAVE_UNSETENV   1

+ 1 - 0
include/build_config/SDL_build_config_windows.h

@@ -135,6 +135,7 @@ typedef unsigned int uintptr_t;
 #define HAVE_MALLOC 1
 #define HAVE_MALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_REALLOC 1
 #define HAVE_REALLOC 1
+#define HAVE_FDATASYNC 1
 #define HAVE_FREE 1
 #define HAVE_FREE 1
 #define HAVE_ABS 1
 #define HAVE_ABS 1
 #define HAVE_MEMSET 1
 #define HAVE_MEMSET 1

+ 1 - 0
include/build_config/SDL_build_config_wingdk.h

@@ -75,6 +75,7 @@
 #define HAVE_LIBC   1
 #define HAVE_LIBC   1
 #define HAVE_MALLOC 1
 #define HAVE_MALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_CALLOC 1
+#define HAVE_FDATASYNC 1
 #define HAVE_REALLOC 1
 #define HAVE_REALLOC 1
 #define HAVE_FREE 1
 #define HAVE_FREE 1
 #define HAVE_ABS 1
 #define HAVE_ABS 1

+ 3 - 1
src/SDL.c

@@ -662,7 +662,9 @@ const char *SDL_GetRevision(void)
 // Get the name of the platform
 // Get the name of the platform
 const char *SDL_GetPlatform(void)
 const char *SDL_GetPlatform(void)
 {
 {
-#if defined(SDL_PLATFORM_AIX)
+#if defined(SDL_PLATFORM_PRIVATE)
+    return SDL_PLATFORM_PRIVATE_NAME;
+#elif defined(SDL_PLATFORM_AIX)
     return "AIX";
     return "AIX";
 #elif defined(SDL_PLATFORM_ANDROID)
 #elif defined(SDL_PLATFORM_ANDROID)
     return "Android";
     return "Android";

+ 3 - 1
src/SDL_assert.c

@@ -245,7 +245,9 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
             state = (SDL_AssertState)selected;
             state = (SDL_AssertState)selected;
         }
         }
     } else {
     } else {
-#ifdef SDL_PLATFORM_EMSCRIPTEN
+#ifdef SDL_PLATFORM_PRIVATE_ASSERT
+        SDL_PRIVATE_PROMPTASSERTION();
+#elif defined(SDL_PLATFORM_EMSCRIPTEN)
         // This is nasty, but we can't block on a custom UI.
         // This is nasty, but we can't block on a custom UI.
         for (;;) {
         for (;;) {
             bool okay = true;
             bool okay = true;

+ 2 - 2
src/SDL_utils.c

@@ -20,7 +20,7 @@
 */
 */
 #include "SDL_internal.h"
 #include "SDL_internal.h"
 
 
-#if defined(SDL_PLATFORM_UNIX) || defined(SDL_PLATFORM_APPLE)
+#ifdef HAVE_GETHOSTNAME
 #include <unistd.h>
 #include <unistd.h>
 #endif
 #endif
 
 
@@ -299,7 +299,7 @@ int SDL_URIToLocal(const char *src, char *dst)
             const size_t src_len = hostname_end - (src + 1);
             const size_t src_len = hostname_end - (src + 1);
             size_t hostname_len;
             size_t hostname_len;
 
 
-#if defined(SDL_PLATFORM_UNIX) || defined(SDL_PLATFORM_APPLE)
+#ifdef HAVE_GETHOSTNAME
             char hostname[257];
             char hostname[257];
             if (gethostname(hostname, 255) == 0) {
             if (gethostname(hostname, 255) == 0) {
                 hostname[256] = '\0';
                 hostname[256] = '\0';

+ 3 - 0
src/audio/SDL_audio.c

@@ -26,6 +26,9 @@
 
 
 // Available audio drivers
 // Available audio drivers
 static const AudioBootStrap *const bootstrap[] = {
 static const AudioBootStrap *const bootstrap[] = {
+#ifdef SDL_AUDIO_DRIVER_PRIVATE
+    &PRIVATEAUDIO_bootstrap,
+#endif
 #ifdef SDL_AUDIO_DRIVER_PULSEAUDIO
 #ifdef SDL_AUDIO_DRIVER_PULSEAUDIO
 #ifdef SDL_AUDIO_DRIVER_PIPEWIRE
 #ifdef SDL_AUDIO_DRIVER_PIPEWIRE
     &PIPEWIRE_PREFERRED_bootstrap,
     &PIPEWIRE_PREFERRED_bootstrap,

+ 1 - 0
src/audio/SDL_sysaudio.h

@@ -353,6 +353,7 @@ typedef struct AudioBootStrap
 } AudioBootStrap;
 } AudioBootStrap;
 
 
 // Not all of these are available in a given build. Use #ifdefs, etc.
 // Not all of these are available in a given build. Use #ifdefs, etc.
+extern AudioBootStrap PRIVATEAUDIO_bootstrap;
 extern AudioBootStrap PIPEWIRE_PREFERRED_bootstrap;
 extern AudioBootStrap PIPEWIRE_PREFERRED_bootstrap;
 extern AudioBootStrap PIPEWIRE_bootstrap;
 extern AudioBootStrap PIPEWIRE_bootstrap;
 extern AudioBootStrap PULSEAUDIO_bootstrap;
 extern AudioBootStrap PULSEAUDIO_bootstrap;

+ 0 - 2
src/camera/SDL_syscamera.h

@@ -27,8 +27,6 @@
 
 
 #define DEBUG_CAMERA 0
 #define DEBUG_CAMERA 0
 
 
-typedef struct SDL_Camera SDL_Camera;
-
 /* Backends should call this as devices are added to the system (such as
 /* Backends should call this as devices are added to the system (such as
    a USB camera being plugged in), and should also be called for
    a USB camera being plugged in), and should also be called for
    for every device found during DetectDevices(). */
    for every device found during DetectDevices(). */

+ 3 - 1
src/dynapi/SDL_dynapi.h

@@ -43,7 +43,9 @@
 #include "TargetConditionals.h"
 #include "TargetConditionals.h"
 #endif
 #endif
 
 
-#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE // probably not useful on iOS.
+#if defined(SDL_PLATFORM_PRIVATE) // probably not useful on private platforms.
+#define SDL_DYNAMIC_API 0
+#elif defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE // probably not useful on iOS.
 #define SDL_DYNAMIC_API 0
 #define SDL_DYNAMIC_API 0
 #elif defined(SDL_PLATFORM_ANDROID) // probably not useful on Android.
 #elif defined(SDL_PLATFORM_ANDROID) // probably not useful on Android.
 #define SDL_DYNAMIC_API 0
 #define SDL_DYNAMIC_API 0

+ 1 - 3
src/file/SDL_iostream.c

@@ -370,10 +370,8 @@ static int SDL_fdatasync(int fd)
     result = fcntl(fd, F_FULLFSYNC);
     result = fcntl(fd, F_FULLFSYNC);
 #elif defined(SDL_PLATFORM_HAIKU)
 #elif defined(SDL_PLATFORM_HAIKU)
     result = fsync(fd);
     result = fsync(fd);
-#elif defined(_POSIX_SYNCHRONIZED_IO)  // POSIX defines this if fdatasync() exists, so we don't need a CMake test.
-#ifndef SDL_PLATFORM_RISCOS  // !!! FIXME: however, RISCOS doesn't have the symbol...maybe we need to link to an extra library or something?
+#elif defined(HAVE_FDATASYNC)
     result = fdatasync(fd);
     result = fdatasync(fd);
-#endif
 #endif
 #endif
     return result;
     return result;
 }
 }

+ 3 - 0
src/joystick/SDL_gamepad_db.h

@@ -29,6 +29,9 @@
    Alternatively, you can use the app located in test/controllermap
    Alternatively, you can use the app located in test/controllermap
  */
  */
 static const char *s_GamepadMappings[] = {
 static const char *s_GamepadMappings[] = {
+#ifdef SDL_JOYSTICK_PRIVATE
+    SDL_PRIVATE_GAMEPAD_DEFINITIONS
+#endif
 #ifdef SDL_JOYSTICK_XINPUT
 #ifdef SDL_JOYSTICK_XINPUT
     "xinput,*,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
     "xinput,*,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
 #endif
 #endif

+ 3 - 0
src/joystick/SDL_joystick.c

@@ -52,6 +52,9 @@ static SDL_JoystickDriver *SDL_joystick_drivers[] = {
 #ifdef SDL_JOYSTICK_HIDAPI // Highest priority driver for supported devices
 #ifdef SDL_JOYSTICK_HIDAPI // Highest priority driver for supported devices
     &SDL_HIDAPI_JoystickDriver,
     &SDL_HIDAPI_JoystickDriver,
 #endif
 #endif
+#ifdef SDL_JOYSTICK_PRIVATE
+    &SDL_PRIVATE_JoystickDriver,
+#endif
 #ifdef SDL_JOYSTICK_GAMEINPUT // Higher priority than other Windows drivers
 #ifdef SDL_JOYSTICK_GAMEINPUT // Higher priority than other Windows drivers
     &SDL_GAMEINPUT_JoystickDriver,
     &SDL_GAMEINPUT_JoystickDriver,
 #endif
 #endif

+ 1 - 0
src/joystick/SDL_sysjoystick.h

@@ -240,6 +240,7 @@ typedef struct SDL_JoystickDriver
 #define SDL_LED_MIN_REPEAT_MS 5000
 #define SDL_LED_MIN_REPEAT_MS 5000
 
 
 // The available joystick drivers
 // The available joystick drivers
+extern SDL_JoystickDriver SDL_PRIVATE_JoystickDriver;
 extern SDL_JoystickDriver SDL_ANDROID_JoystickDriver;
 extern SDL_JoystickDriver SDL_ANDROID_JoystickDriver;
 extern SDL_JoystickDriver SDL_BSD_JoystickDriver;
 extern SDL_JoystickDriver SDL_BSD_JoystickDriver;
 extern SDL_JoystickDriver SDL_DARWIN_JoystickDriver;
 extern SDL_JoystickDriver SDL_DARWIN_JoystickDriver;

+ 8 - 0
src/thread/pthread/SDL_systhread.c

@@ -26,7 +26,9 @@
 #include <pthread_np.h>
 #include <pthread_np.h>
 #endif
 #endif
 
 
+#ifdef HAVE_SIGNAL_H
 #include <signal.h>
 #include <signal.h>
+#endif
 #include <errno.h>
 #include <errno.h>
 
 
 #ifdef SDL_PLATFORM_LINUX
 #ifdef SDL_PLATFORM_LINUX
@@ -55,11 +57,13 @@
 #include <kernel/OS.h>
 #include <kernel/OS.h>
 #endif
 #endif
 
 
+#ifdef HAVE_SIGNAL_H
 // List of signals to mask in the subthreads
 // List of signals to mask in the subthreads
 static const int sig_list[] = {
 static const int sig_list[] = {
     SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH,
     SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH,
     SIGVTALRM, SIGPROF, 0
     SIGVTALRM, SIGPROF, 0
 };
 };
+#endif
 
 
 static void *RunThread(void *data)
 static void *RunThread(void *data)
 {
 {
@@ -117,8 +121,10 @@ bool SDL_SYS_CreateThread(SDL_Thread *thread,
 
 
 void SDL_SYS_SetupThread(const char *name)
 void SDL_SYS_SetupThread(const char *name)
 {
 {
+#ifdef HAVE_SIGNAL_H
     int i;
     int i;
     sigset_t mask;
     sigset_t mask;
+#endif
 
 
     if (name) {
     if (name) {
 #if (defined(SDL_PLATFORM_MACOS) || defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_LINUX)) && defined(HAVE_DLOPEN)
 #if (defined(SDL_PLATFORM_MACOS) || defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_LINUX)) && defined(HAVE_DLOPEN)
@@ -154,12 +160,14 @@ void SDL_SYS_SetupThread(const char *name)
 #endif
 #endif
     }
     }
 
 
+#ifdef HAVE_SIGNAL_H
     // Mask asynchronous signals for this thread
     // Mask asynchronous signals for this thread
     sigemptyset(&mask);
     sigemptyset(&mask);
     for (i = 0; sig_list[i]; ++i) {
     for (i = 0; sig_list[i]; ++i) {
         sigaddset(&mask, sig_list[i]);
         sigaddset(&mask, sig_list[i]);
     }
     }
     pthread_sigmask(SIG_BLOCK, &mask, 0);
     pthread_sigmask(SIG_BLOCK, &mask, 0);
+#endif
 
 
 #ifdef PTHREAD_CANCEL_ASYNCHRONOUS
 #ifdef PTHREAD_CANCEL_ASYNCHRONOUS
     // Allow ourselves to be asynchronously cancelled
     // Allow ourselves to be asynchronously cancelled

+ 2 - 3
src/video/SDL_egl.c

@@ -300,7 +300,9 @@ void SDL_EGL_UnloadLibrary(SDL_VideoDevice *_this)
 static bool SDL_EGL_LoadLibraryInternal(SDL_VideoDevice *_this, const char *egl_path)
 static bool SDL_EGL_LoadLibraryInternal(SDL_VideoDevice *_this, const char *egl_path)
 {
 {
     SDL_SharedObject *egl_dll_handle = NULL;
     SDL_SharedObject *egl_dll_handle = NULL;
+#if !defined(SDL_VIDEO_STATIC_ANGLE) && !defined(SDL_VIDEO_DRIVER_VITA)
     SDL_SharedObject *opengl_dll_handle = NULL;
     SDL_SharedObject *opengl_dll_handle = NULL;
+#endif
     const char *path = NULL;
     const char *path = NULL;
 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
     const char *d3dcompiler;
     const char *d3dcompiler;
@@ -426,9 +428,6 @@ static bool SDL_EGL_LoadLibraryInternal(SDL_VideoDevice *_this, const char *egl_
 #endif
 #endif
 
 
     _this->egl_data->egl_dll_handle = egl_dll_handle;
     _this->egl_data->egl_dll_handle = egl_dll_handle;
-#ifdef SDL_VIDEO_DRIVER_VITA
-    _this->egl_data->opengl_dll_handle = opengl_dll_handle;
-#endif
 
 
     // Load new function pointers
     // Load new function pointers
     LOAD_FUNC(PFNEGLGETDISPLAYPROC, eglGetDisplay);
     LOAD_FUNC(PFNEGLGETDISPLAYPROC, eglGetDisplay);

+ 1 - 0
src/video/SDL_sysvideo.h

@@ -498,6 +498,7 @@ typedef struct VideoBootStrap
 } VideoBootStrap;
 } VideoBootStrap;
 
 
 // Not all of these are available in a given build. Use #ifdefs, etc.
 // Not all of these are available in a given build. Use #ifdefs, etc.
+extern VideoBootStrap PRIVATE_bootstrap;
 extern VideoBootStrap COCOA_bootstrap;
 extern VideoBootStrap COCOA_bootstrap;
 extern VideoBootStrap X11_bootstrap;
 extern VideoBootStrap X11_bootstrap;
 extern VideoBootStrap WINDOWS_bootstrap;
 extern VideoBootStrap WINDOWS_bootstrap;

+ 3 - 0
src/video/SDL_video.c

@@ -71,6 +71,9 @@
 
 
 // Available video drivers
 // Available video drivers
 static VideoBootStrap *bootstrap[] = {
 static VideoBootStrap *bootstrap[] = {
+#ifdef SDL_VIDEO_DRIVER_PRIVATE
+    &PRIVATE_bootstrap,
+#endif
 #ifdef SDL_VIDEO_DRIVER_COCOA
 #ifdef SDL_VIDEO_DRIVER_COCOA
     &COCOA_bootstrap,
     &COCOA_bootstrap,
 #endif
 #endif