Skip to content

Commit

Permalink
Fix 64-bit FreeBSD build
Browse files Browse the repository at this point in the history
  • Loading branch information
endrift committed Jul 12, 2015
1 parent a6437f6 commit fff113b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ endif()
if(NOT ENABLE_GENERIC)
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR
${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86" OR
${CMAKE_SYSTEM_PROCESSOR} MATCHES "amd64" OR
APPLE)
if(_ARCH_64)
set(_M_X86 1)
Expand Down
7 changes: 7 additions & 0 deletions Source/Core/Core/MemTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#ifndef _M_GENERIC
#include "Core/PowerPC/JitCommon/JitBase.h"
#endif
#ifdef __FreeBSD__
#include <signal.h>
#endif

namespace EMM
{
Expand Down Expand Up @@ -256,7 +259,11 @@ static void sigsegv_handler(int sig, siginfo_t *info, void *raw_context)
void InstallExceptionHandler()
{
stack_t signal_stack;
#ifdef __FreeBSD__
signal_stack.ss_sp = (char*)malloc(SIGSTKSZ);
#else
signal_stack.ss_sp = malloc(SIGSTKSZ);
#endif
signal_stack.ss_size = SIGSTKSZ;
signal_stack.ss_flags = 0;
if (sigaltstack(&signal_stack, nullptr))
Expand Down

0 comments on commit fff113b

Please sign in to comment.