Improve support for private platforms (#11220)

This commit is contained in:
Caleb Cornett
2024-10-15 18:02:07 -04:00
committed by GitHub
parent 66d09a1cda
commit 9af5ffcfbe
27 changed files with 70 additions and 18 deletions

View File

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