Add GNU/Hurd as platform

SDL has been building on GNU/Hurd for a long time, using either drivers
based on external libraries (e.g. X11, pulseaudio, sndio, etc) or dummy
drivers. This commit introduces it explicitly as platform, so it can be
recognized, and tweaked as needed. In particular:
- introduce the SDL_PLATFORM_HURD define
- tighten/improve the platform detection in cmake, and use "Hurd" as
  identifier
- return the platform name in SDL_GetPlatform()
- tweak the CFLAGS/LDFLAGS so pthreads can be used properly
- implement SDL_GetExeName(), using /proc/self/exe as provided by the
  basic Linux-like procfs
- enable GLES 2 in tests (mostly for consistency with Linux)
This commit is contained in:
Pino Toscano
2025-08-07 23:35:39 +02:00
committed by Sam Lantinga
parent b63c32e790
commit 171885010d
6 changed files with 20 additions and 5 deletions

View File

@@ -484,4 +484,14 @@
#define SDL_PLATFORM_NGAGE 1
#endif
#ifdef __GNU__
/**
* A preprocessor macro that is only defined if compiling for GNU/Hurd.
*
* \since This macro is available since SDL 3.4.0.
*/
#define SDL_PLATFORM_HURD 1
#endif
#endif /* SDL_platform_defines_h_ */