mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
not all systems have _SC_PAGESIZE
This commit is contained in:
parent
d68c6c0d5b
commit
ff6e0ab1b3
2 changed files with 12 additions and 1 deletions
11
configure.ac
11
configure.ac
|
@ -189,6 +189,17 @@ AC_STRUCT_ST_BLKSIZE
|
|||
AC_HEADER_TIME
|
||||
AC_STRUCT_TM
|
||||
|
||||
if test "$ac_cv_header_unistd_h" = yes; then
|
||||
AC_MSG_CHECKING(for _SC_PAGESIZE)
|
||||
AC_TRY_COMPILE(
|
||||
[#include <unistd.h>],
|
||||
[int foo = _SC_PAGESIZE;],
|
||||
AC_DEFINE(HAVE__SC_PAGESIZE,1,[Define this if you have _SC_PAGESIZE])
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for __attribute__)
|
||||
AC_TRY_COMPILE(
|
||||
[static __attribute__ ((unused)) const char *foo = "bar";],
|
||||
|
|
|
@ -340,7 +340,7 @@ Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
|
|||
# ifdef HAVE_MPROTECT
|
||||
int r;
|
||||
unsigned long endaddr = startaddr + length;
|
||||
# ifdef HAVE_UNISTD_H
|
||||
# ifdef HAVE__SC_PAGESIZE
|
||||
long psize = sysconf (_SC_PAGESIZE);
|
||||
|
||||
startaddr &= ~(psize - 1);
|
||||
|
|
Loading…
Reference in a new issue