diff --git a/common/include/intrin_x86.h b/common/include/intrin_x86.h index 9f40fc31e1..a1f9305762 100644 --- a/common/include/intrin_x86.h +++ b/common/include/intrin_x86.h @@ -843,7 +843,9 @@ static __inline__ __attribute__((always_inline)) unsigned long long __xgetbv(uns return ((unsigned long long)edx << 32) | eax; } -static __inline__ __attribute__((always_inline)) unsigned long long __rdtsc(void) +// gcc 4.8 define __rdtsc but unfortunately the compiler crash... +// The redefine allow to skip the gcc __rdtsc version -- Gregory +static __inline__ __attribute__((always_inline)) unsigned long long __pcsx2__rdtsc(void) { unsigned long long retval; __asm__ __volatile__("rdtsc" : "=A"(retval)); diff --git a/common/src/x86emitter/cpudetect.cpp b/common/src/x86emitter/cpudetect.cpp index 649e105321..b6a6cbc6f8 100644 --- a/common/src/x86emitter/cpudetect.cpp +++ b/common/src/x86emitter/cpudetect.cpp @@ -93,12 +93,12 @@ s64 x86capabilities::_CPUSpeedHz( u64 time ) const do { timeStart = GetCPUTicks(); - startCycle = __rdtsc(); + startCycle = __pcsx2__rdtsc(); } while( GetCPUTicks() == timeStart ); do { timeStop = GetCPUTicks(); - endCycle = __rdtsc(); + endCycle = __pcsx2__rdtsc(); } while( ( timeStop - timeStart ) < time ); s64 cycleCount = endCycle - startCycle; diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index d948597962..4446936167 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -19,6 +19,7 @@ set(CommonFlags -fno-tree-dse -fno-strict-aliasing -Wstrict-aliasing # Allow to track strict aliasing issue. + -std=c++0x -pipe) if (SPARSEHASH_NEW_FOUND) diff --git a/pcsx2/gui/Debugger/BreakpointWindow.cpp b/pcsx2/gui/Debugger/BreakpointWindow.cpp index a8c00d9807..6c3f542b52 100644 --- a/pcsx2/gui/Debugger/BreakpointWindow.cpp +++ b/pcsx2/gui/Debugger/BreakpointWindow.cpp @@ -232,7 +232,7 @@ bool BreakpointWindow::fetchDialogData() wxCharBuffer addressText = editAddress->GetLabel().ToUTF8(); if (cpu->initExpression(addressText,exp) == false) { - swprintf(errorMessage,512,L"Invalid expression \"%s\".",editAddress->GetLabel().wchar_str()); + swprintf(errorMessage,512,L"Invalid expression \"%s\".",editAddress->GetLabel().wchar_str().data()); wxMessageBox(errorMessage,L"Error",wxICON_ERROR); return false; } @@ -240,7 +240,7 @@ bool BreakpointWindow::fetchDialogData() u64 value; if (cpu->parseExpression(exp,value) == false) { - swprintf(errorMessage,512,L"Invalid expression \"%s\".",editAddress->GetLabel().wchar_str()); + swprintf(errorMessage,512,L"Invalid expression \"%s\".",editAddress->GetLabel().wchar_str().data()); wxMessageBox(errorMessage,L"Error",wxICON_ERROR); return false; } @@ -252,14 +252,14 @@ bool BreakpointWindow::fetchDialogData() wxCharBuffer sizeText = editSize->GetLabel().ToUTF8(); if (cpu->initExpression(sizeText,exp) == false) { - swprintf(errorMessage,512,L"Invalid expression \"%s\".",editSize->GetLabel().wchar_str()); + swprintf(errorMessage,512,L"Invalid expression \"%s\".",editSize->GetLabel().wchar_str().data()); wxMessageBox(errorMessage,L"Error",wxICON_ERROR); return false; } if (cpu->parseExpression(exp,value) == false) { - swprintf(errorMessage,512,L"Invalid expression \"%s\".",editSize->GetLabel().wchar_str()); + swprintf(errorMessage,512,L"Invalid expression \"%s\".",editSize->GetLabel().wchar_str().data()); wxMessageBox(errorMessage,L"Error",wxICON_ERROR); return false; } @@ -276,7 +276,7 @@ bool BreakpointWindow::fetchDialogData() { if (cpu->initExpression(condition,compiledCondition) == false) { - swprintf(errorMessage,512,L"Invalid expression \"%s\".",editCondition->GetLabel().wchar_str()); + swprintf(errorMessage,512,L"Invalid expression \"%s\".",editCondition->GetLabel().wchar_str().data()); wxMessageBox(errorMessage,L"Error",wxICON_ERROR); return false; }