Fix compilation on OpenBSD.

Thanks to Laurence Tratt.
This commit is contained in:
Mike Pall 2012-03-15 12:01:13 +01:00
parent 6670a13bbf
commit 5dbb6671a3
2 changed files with 3 additions and 3 deletions

View File

@ -188,14 +188,14 @@ static LJ_AINLINE void *CALL_MMAP(size_t size)
return ptr; return ptr;
} }
#elif LJ_TARGET_OSX || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #elif LJ_TARGET_OSX || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
/* OSX and FreeBSD mmap() use a naive first-fit linear search. /* OSX and FreeBSD mmap() use a naive first-fit linear search.
** That's perfect for us. Except that -pagezero_size must be set for OSX, ** That's perfect for us. Except that -pagezero_size must be set for OSX,
** otherwise the lower 4GB are blocked. And the 32GB RLIMIT_DATA needs ** otherwise the lower 4GB are blocked. And the 32GB RLIMIT_DATA needs
** to be reduced to 250MB on FreeBSD. ** to be reduced to 250MB on FreeBSD.
*/ */
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
#include <sys/resource.h> #include <sys/resource.h>
#define MMAP_REGION_START ((uintptr_t)0x10000000) #define MMAP_REGION_START ((uintptr_t)0x10000000)
#else #else

View File

@ -264,7 +264,7 @@ LJ_FUNCA int lj_err_unwind_dwarf(int version, _Unwind_Action actions,
} }
#if LJ_UNWIND_EXT #if LJ_UNWIND_EXT
#if LJ_TARGET_OSX #if LJ_TARGET_OSX || defined(__OpenBSD__)
/* Sorry, no thread safety for OSX. Complain to Apple, not me. */ /* Sorry, no thread safety for OSX. Complain to Apple, not me. */
static struct _Unwind_Exception static_uex; static struct _Unwind_Exception static_uex;
#else #else