Deal with the (historic) MAP_ANONYMOUS vs MAP_ANON directly by using CPP

to check for the former, don't depend on (dangling) HAVE_MMAP_ANONYMOUS.

llvm-svn: 282925
This commit is contained in:
Joerg Sonnenberger 2016-09-30 20:17:23 +00:00
parent 18a2fb2d28
commit 10c45e226b
2 changed files with 2 additions and 6 deletions

View File

@ -160,10 +160,6 @@
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define if mmap() uses MAP_ANONYMOUS to map anonymous pages, or undefine if
it uses MAP_ANON */
#undef HAVE_MMAP_ANONYMOUS
/* Define if mmap() can map files into memory */
#undef HAVE_MMAP_FILE

View File

@ -93,7 +93,7 @@ Memory::allocateMappedMemory(size_t NumBytes,
int fd = -1;
int MMFlags = MAP_PRIVATE |
#ifdef HAVE_MMAP_ANONYMOUS
#ifdef MAP_ANONYMOUS
MAP_ANONYMOUS
#else
MAP_ANON
@ -179,7 +179,7 @@ Memory::AllocateRWX(size_t NumBytes, const MemoryBlock* NearBlock,
int fd = -1;
int flags = MAP_PRIVATE |
#ifdef HAVE_MMAP_ANONYMOUS
#ifdef MAP_ANONYMOUS
MAP_ANONYMOUS
#else
MAP_ANON