Add unistd.h checks back to the CMake build.
getpagesize(), as well as its POSIX.2001 replacement sysconf(_SC_PAGESIZE), is defined in <unistd.h>. On Linux and OS X, including <sys/mman.h> is sufficient to get a definition for getpagesize(). However, this is not true for the Android NDK. This CL brings back the HAVE_UNISTD_H definition and its associated header check. This also adds a HAVE_FUNC_SYSCONF definition, which checks for the presence of sysconf(). The definition can be used later to replace getpagesize() with sysconf().
This commit is contained in:
@@ -45,6 +45,10 @@
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#include <intrin.h>
|
||||
#endif // defined(_MSC_VER)
|
||||
|
||||
Reference in New Issue
Block a user