Skip to content

Commit ea8e66c

Browse files
committed
Don't use getpagesize() on Windows
Fixes #14328
1 parent 6493be9 commit ea8e66c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/cpuinfo/SDL_cpuinfo.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929

3030
// CPU feature detection for SDL
3131

32-
#if defined(HAVE_SYSCONF) || defined(HAVE_GETPAGESIZE)
32+
#if defined(HAVE_GETPAGESIZE) && !defined(SDL_PLATFORM_WINDOWS)
33+
#define USE_GETPAGESIZE
34+
#endif
35+
36+
#if defined(HAVE_SYSCONF) || defined(USE_GETPAGESIZE)
3337
#include <unistd.h>
3438
#endif
3539
#ifdef HAVE_SYSCTLBYNAME
@@ -1252,7 +1256,7 @@ int SDL_GetSystemPageSize(void)
12521256
}
12531257
}
12541258
#endif
1255-
#ifdef HAVE_GETPAGESIZE
1259+
#ifdef USE_GETPAGESIZE
12561260
if (SDL_SystemPageSize <= 0) {
12571261
SDL_SystemPageSize = getpagesize();
12581262
}

0 commit comments

Comments
 (0)