Fix 64-bit FreeBSD build

This commit is contained in:
Jeffrey Pfau 2015-06-11 23:34:16 -07:00
parent a6437f629c
commit fff113b64f
2 changed files with 8 additions and 0 deletions

View File

@ -160,6 +160,7 @@ endif()
if(NOT ENABLE_GENERIC) if(NOT ENABLE_GENERIC)
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR
${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86" OR
${CMAKE_SYSTEM_PROCESSOR} MATCHES "amd64" OR
APPLE) APPLE)
if(_ARCH_64) if(_ARCH_64)
set(_M_X86 1) set(_M_X86 1)

View File

@ -18,6 +18,9 @@
#ifndef _M_GENERIC #ifndef _M_GENERIC
#include "Core/PowerPC/JitCommon/JitBase.h" #include "Core/PowerPC/JitCommon/JitBase.h"
#endif #endif
#ifdef __FreeBSD__
#include <signal.h>
#endif
namespace EMM namespace EMM
{ {
@ -256,7 +259,11 @@ static void sigsegv_handler(int sig, siginfo_t *info, void *raw_context)
void InstallExceptionHandler() void InstallExceptionHandler()
{ {
stack_t signal_stack; stack_t signal_stack;
#ifdef __FreeBSD__
signal_stack.ss_sp = (char*)malloc(SIGSTKSZ);
#else
signal_stack.ss_sp = malloc(SIGSTKSZ); signal_stack.ss_sp = malloc(SIGSTKSZ);
#endif
signal_stack.ss_size = SIGSTKSZ; signal_stack.ss_size = SIGSTKSZ;
signal_stack.ss_flags = 0; signal_stack.ss_flags = 0;
if (sigaltstack(&signal_stack, nullptr)) if (sigaltstack(&signal_stack, nullptr))