linux compilation fix:

* use c++11 for pcsx2
* rename __rdtsc so I won't conflict with gnu version
* add a bunch of .data() method to get string data



git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5913 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut 2014-02-23 09:57:01 +00:00
parent c374343ae9
commit 220f55d760
4 changed files with 11 additions and 8 deletions

View File

@ -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));

View File

@ -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;

View File

@ -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)

View File

@ -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;
}