From e10ed744bcfb968c7543ec711af188ac6299c499 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Tue, 17 May 2016 23:43:02 +0100 Subject: [PATCH] pcsx2:freebsd: Fix build --- pcsx2/AsyncFileReader.h | 2 +- pcsx2/CMakeLists.txt | 12 ++++++++++++ pcsx2/IPU/yuv2rgb.cpp | 7 ++++--- pcsx2/PrecompiledHeader.h | 8 +------- pcsx2/gui/ConsoleLogger.cpp | 6 +++--- pcsx2/gui/FrameForGS.cpp | 8 ++++---- pcsx2/gui/MainFrame.cpp | 4 ++-- pcsx2/gui/i18n.cpp | 2 +- 8 files changed, 28 insertions(+), 21 deletions(-) diff --git a/pcsx2/AsyncFileReader.h b/pcsx2/AsyncFileReader.h index decc97ceb5..368cf777dd 100644 --- a/pcsx2/AsyncFileReader.h +++ b/pcsx2/AsyncFileReader.h @@ -20,7 +20,7 @@ # undef Yield #elif defined(__linux__) # include -#elif defined(__APPLE__) +#elif defined(__POSIX__) # include #endif #include diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index b294cc7e5f..222cf3fd5c 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -397,6 +397,12 @@ set(pcsx2OSXSources Darwin/DarwinFlatFileReader.cpp ) +set(pcsx2FreeBSDSources + Linux/LnxConsolePipe.cpp + Linux/LnxKeyCodes.cpp + Darwin/DarwinFlatFileReader.cpp + ) + # Linux headers set(pcsx2LinuxHeaders ) @@ -615,6 +621,12 @@ if(APPLE) ${pcsx2LinuxHeaders}) endif() +if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + set(Platform + ${pcsx2FreeBSDSources} + ${pcsx2LinuxHeaders}) +endif() + set(pcsx2FinalSources ${Common} ${Platform} diff --git a/pcsx2/IPU/yuv2rgb.cpp b/pcsx2/IPU/yuv2rgb.cpp index 5fae01f7b6..ffd9ce1cca 100644 --- a/pcsx2/IPU/yuv2rgb.cpp +++ b/pcsx2/IPU/yuv2rgb.cpp @@ -58,13 +58,13 @@ void yuv2rgb_reference(void) } } +#if defined(_M_X86_32) // TODO OSX optimize me -#ifdef __APPLE__ +#if defined(__clang__) && !defined(__linux__) void yuv2rgb_sse2() { yuv2rgb_reference(); } - -#elif defined(_M_X86_32) +#else // Everything below is bit accurate to the IPU specification (except maybe rounding). // Know the specification before you touch it. #define SSE_BYTES(x) {x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x} @@ -411,3 +411,4 @@ ihatemsvc: #endif } #endif +#endif diff --git a/pcsx2/PrecompiledHeader.h b/pcsx2/PrecompiledHeader.h index a9dc78ab24..1bd728c9fe 100644 --- a/pcsx2/PrecompiledHeader.h +++ b/pcsx2/PrecompiledHeader.h @@ -96,13 +96,7 @@ typedef FnType_Void* Fnptr_Void; #else // must be GCC or Clang -# include -# include - -// Definitions added Feb 16, 2006 by efp -# ifndef __declspec -# define __declspec(x) -# endif +#include #endif diff --git a/pcsx2/gui/ConsoleLogger.cpp b/pcsx2/gui/ConsoleLogger.cpp index 4307e62a80..fb3eb86132 100644 --- a/pcsx2/gui/ConsoleLogger.cpp +++ b/pcsx2/gui/ConsoleLogger.cpp @@ -1017,11 +1017,11 @@ void Pcsx2App::ProgramLog_PostEvent( wxEvent& evt ) static void __concall ConsoleToFile_Newline() { -#ifdef __linux__ +#if defined(__unix__) if ((g_Conf) && (g_Conf->EmuOptions.ConsoleToStdio)) ConsoleWriter_Stdout.Newline(); #endif -#ifdef __linux__ +#if defined(__unix__) fputc( '\n', emuLog ); #else fputs( "\r\n", emuLog ); @@ -1030,7 +1030,7 @@ static void __concall ConsoleToFile_Newline() static void __concall ConsoleToFile_DoWrite( const wxString& fmt ) { -#ifdef __linux__ +#if defined(__unix__) if ((g_Conf) && (g_Conf->EmuOptions.ConsoleToStdio)) ConsoleWriter_Stdout.WriteRaw(fmt); #endif diff --git a/pcsx2/gui/FrameForGS.cpp b/pcsx2/gui/FrameForGS.cpp index 6a754baaa7..de18b01bb6 100644 --- a/pcsx2/gui/FrameForGS.cpp +++ b/pcsx2/gui/FrameForGS.cpp @@ -222,7 +222,7 @@ void GSPanel::OnMouseEvent( wxMouseEvent& evt ) DoShowMouse(); } -#ifdef __linux__ +#if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { @@ -285,7 +285,7 @@ void GSPanel::OnKeyDownOrUp( wxKeyEvent& evt ) // to the APP level message handler, which in turn routes them right back here -- yes it's // silly, but oh well). -#ifdef __linux__ +#if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { @@ -367,7 +367,7 @@ void GSPanel::OnFocus( wxFocusEvent& evt ) else DoShowMouse(); -#ifdef __linux__ +#if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { @@ -385,7 +385,7 @@ void GSPanel::OnFocusLost( wxFocusEvent& evt ) evt.Skip(); m_HasFocus = false; DoShowMouse(); -#ifdef __linux__ +#if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index fa7ff78bbf..a9b46d767c 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -503,7 +503,7 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title) // ------------------------------------------------------------------------ m_menuMisc.Append( &m_MenuItem_Console ); -#ifdef __linux__ +#if defined(__unix__) m_menuMisc.Append( &m_MenuItem_Console_Stdio ); #endif //Todo: Though not many people need this one :p @@ -695,7 +695,7 @@ void MainEmuFrame::ApplyConfigToGui(AppConfig& configToApply, int flags) menubar.Check( MenuId_EnableCheats, configToApply.EmuOptions.EnableCheats ); menubar.Check( MenuId_EnableWideScreenPatches, configToApply.EmuOptions.EnableWideScreenPatches ); menubar.Check( MenuId_EnableHostFs, configToApply.EmuOptions.HostFs ); -#ifdef __linux__ +#if defined(__unix__) menubar.Check( MenuId_Console_Stdio, configToApply.EmuOptions.ConsoleToStdio ); #endif diff --git a/pcsx2/gui/i18n.cpp b/pcsx2/gui/i18n.cpp index 8bd1726ad3..77e8dd7c55 100644 --- a/pcsx2/gui/i18n.cpp +++ b/pcsx2/gui/i18n.cpp @@ -362,7 +362,7 @@ void i18n_SetLanguagePath() // default location for windows wxLocale::AddCatalogLookupPathPrefix( wxGetCwd() ); // additional location for linux -#ifdef __linux__ +#ifdef __unix__ wxLocale::AddCatalogLookupPathPrefix( PathDefs::GetLangs().ToString() ); #endif