Don't use getpagesize() on Windows

Fixes https://github.com/libsdl-org/SDL/issues/14328
This commit is contained in:
Sam Lantinga
2025-11-03 08:36:29 -08:00
parent 6493be9eea
commit ea8e66ccd1

View File

@@ -29,7 +29,11 @@
// CPU feature detection for SDL
#if defined(HAVE_SYSCONF) || defined(HAVE_GETPAGESIZE)
#if defined(HAVE_GETPAGESIZE) && !defined(SDL_PLATFORM_WINDOWS)
#define USE_GETPAGESIZE
#endif
#if defined(HAVE_SYSCONF) || defined(USE_GETPAGESIZE)
#include <unistd.h>
#endif
#ifdef HAVE_SYSCTLBYNAME
@@ -1252,7 +1256,7 @@ int SDL_GetSystemPageSize(void)
}
}
#endif
#ifdef HAVE_GETPAGESIZE
#ifdef USE_GETPAGESIZE
if (SDL_SystemPageSize <= 0) {
SDL_SystemPageSize = getpagesize();
}