Various minor fixes to allow building with clang on OS X.
Fixes issue 3992. wxWidgets patch at http://trac.wxwidgets.org/ticket/12332 . git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6929 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
826e37a279
commit
0288742565
11
SConstruct
11
SConstruct
|
@ -126,10 +126,15 @@ if sys.platform == 'darwin':
|
|||
env['CCFLAGS'] += ['-march=core2', '-mdynamic-no-pic']
|
||||
env['CCFLAGS'] += ['-iframework/Developer/SDKs/MacOSX10.5.sdk' + system]
|
||||
env['CCFLAGS'] += ['-iframework/Developer/SDKs/MacOSX10.6.sdk' + system]
|
||||
env['CC'] = '/Developer/usr/bin/llvm-gcc -ObjC'
|
||||
env['CXX'] = '/Developer/usr/bin/llvm-g++ -ObjC++'
|
||||
#env['CC'] = 'clang'
|
||||
#env['CC'] = 'gcc'
|
||||
env['CC'] = 'llvm-gcc'
|
||||
#env['CXX'] = 'clang++'
|
||||
#env['CXX'] = 'g++'
|
||||
env['CXX'] = 'llvm-g++'
|
||||
env['CXXFLAGS'] += ['-x', 'objective-c++']
|
||||
env['FRAMEWORKS'] += ['AppKit', 'Carbon', 'CoreFoundation', 'CoreServices']
|
||||
env['FRAMEWORKS'] += ['AudioUnit', 'CoreAudio', 'WebKit']
|
||||
env['FRAMEWORKS'] += ['AudioToolbox', 'AudioUnit', 'CoreAudio', 'WebKit']
|
||||
env['FRAMEWORKS'] += ['IOBluetooth', 'IOKit', 'OpenGL']
|
||||
env['FRAMEWORKSFLAGS'] = ['-weak_framework', 'OpenCL']
|
||||
env['FRAMEWORKSFLAGS'] += ['-Xarch_i386', '-Wl,-framework,QuickTime']
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include <CoreServices/CoreServices.h>
|
||||
|
||||
#include "CoreAudioSoundStream.h"
|
||||
|
||||
OSStatus callback(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags,
|
||||
|
|
|
@ -42,7 +42,8 @@ const char *GetLastErrorMsg()
|
|||
size_t strnlen(const char *s, size_t n)
|
||||
{
|
||||
const char *p = (const char *)memchr(s, 0, n);
|
||||
return(p ? p-s : n);
|
||||
|
||||
return p ? (size_t)(p - s) : n;
|
||||
}
|
||||
#endif
|
||||
#if defined(_WIN32) || !(__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
|
||||
|
|
|
@ -41,7 +41,6 @@ files = [
|
|||
"Thread.cpp",
|
||||
"Thunk.cpp",
|
||||
"Timer.cpp",
|
||||
"Thread.cpp",
|
||||
"Version.cpp",
|
||||
"x64Emitter.cpp",
|
||||
"x64Analyzer.cpp",
|
||||
|
|
|
@ -56,7 +56,7 @@ struct SConfig : NonCopyable
|
|||
// interface language
|
||||
int m_InterfaceLanguage;
|
||||
// framelimit choose
|
||||
int m_Framelimit;
|
||||
unsigned int m_Framelimit;
|
||||
bool b_UseFPS;
|
||||
// other interface settings
|
||||
bool m_InterfaceToolbar;
|
||||
|
|
|
@ -218,6 +218,7 @@ inline void WriteToHardware(u32 em_address, const T data, u32 effective_address,
|
|||
case 1: GPFifo::Write8((u8)data, em_address); return;
|
||||
case 2: GPFifo::Write16((u16)data, em_address); return;
|
||||
case 4: GPFifo::Write32((u32)data, em_address); return;
|
||||
case 8: GPFifo::Write64((u64)data, em_address); return;
|
||||
}
|
||||
}
|
||||
if ((em_address & 0xC8000000) == 0xC8000000)
|
||||
|
|
|
@ -681,7 +681,7 @@ enum
|
|||
#define EXCEPTION_PROGRAM 0x00000080
|
||||
|
||||
inline s32 SignExt16(s16 x) {return (s32)(s16)x;}
|
||||
inline s32 SignExt26(u32 x) {return x & 0x2000000 ? (s32)x | 0xFC000000 : (s32)(x);}
|
||||
inline s32 SignExt26(u32 x) {return x & 0x2000000 ? (s32)(x | 0xFC000000) : (s32)(x);}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ u32 Interpreter::g_reserveAddr;
|
|||
|
||||
u32 Interpreter::Helper_Get_EA(const UGeckoInstruction _inst)
|
||||
{
|
||||
return _inst.RA ? (m_GPR[_inst.RA] + _inst.SIMM_16) : _inst.SIMM_16;
|
||||
return _inst.RA ? (m_GPR[_inst.RA] + _inst.SIMM_16) : (u32)_inst.SIMM_16;
|
||||
}
|
||||
|
||||
u32 Interpreter::Helper_Get_EA_U(const UGeckoInstruction _inst)
|
||||
|
|
|
@ -158,7 +158,8 @@ void Interpreter::psq_l(UGeckoInstruction _inst)
|
|||
const UGQR gqr(rSPR(SPR_GQR0 + _inst.I));
|
||||
const EQuantizeType ldType = static_cast<EQuantizeType>(gqr.LD_TYPE);
|
||||
const unsigned int ldScale = gqr.LD_SCALE;
|
||||
const u32 EA = _inst.RA ? (m_GPR[_inst.RA] + _inst.SIMM_12) : _inst.SIMM_12;
|
||||
const u32 EA = _inst.RA ?
|
||||
(m_GPR[_inst.RA] + _inst.SIMM_12) : (u32)_inst.SIMM_12;
|
||||
|
||||
int c = 4;
|
||||
if ((ldType == QUANTIZE_U8) || (ldType == QUANTIZE_S8)) c = 0x1;
|
||||
|
@ -227,7 +228,8 @@ void Interpreter::psq_st(UGeckoInstruction _inst)
|
|||
const UGQR gqr(rSPR(SPR_GQR0 + _inst.I));
|
||||
const EQuantizeType stType = static_cast<EQuantizeType>(gqr.ST_TYPE);
|
||||
const unsigned int stScale = gqr.ST_SCALE;
|
||||
const u32 EA = _inst.RA ? (m_GPR[_inst.RA] + _inst.SIMM_12) : _inst.SIMM_12;
|
||||
const u32 EA = _inst.RA ?
|
||||
(m_GPR[_inst.RA] + _inst.SIMM_12) : (u32)_inst.SIMM_12;
|
||||
|
||||
int c = 4;
|
||||
if ((stType == 4) || (stType == 6)) c = 0x1;
|
||||
|
|
|
@ -330,9 +330,10 @@ void CMemoryWindow::onSearch(wxCommandEvent& event)
|
|||
long newsize = 0;
|
||||
unsigned char *tmp2 = 0;
|
||||
char* tmpstr = 0;
|
||||
switch (chkHex->GetValue())
|
||||
|
||||
if (chkHex->GetValue())
|
||||
{
|
||||
case 1://We are looking for hex
|
||||
//We are looking for hex
|
||||
//If it's uneven
|
||||
size = (rawData.size()/2) + pad;
|
||||
Dest.resize(size+32);
|
||||
|
@ -369,8 +370,8 @@ void CMemoryWindow::onSearch(wxCommandEvent& event)
|
|||
i += 1;
|
||||
}
|
||||
delete[] tmpstr;
|
||||
break;
|
||||
case 0://Looking for an ascii string
|
||||
} else {
|
||||
//Looking for an ascii string
|
||||
size = rawData.size();
|
||||
Dest.resize(size+1);
|
||||
tmpstr = new char[size+1];
|
||||
|
@ -382,8 +383,8 @@ void CMemoryWindow::onSearch(wxCommandEvent& event)
|
|||
tmp2[i] = tmpstr[i];
|
||||
|
||||
delete[] tmpstr;
|
||||
break;
|
||||
}
|
||||
|
||||
if(size)
|
||||
{
|
||||
unsigned char* pnt = &Dest.front();
|
||||
|
|
|
@ -41,8 +41,8 @@ CISOFileReader* CISOFileReader::Create(const char* filename)
|
|||
{
|
||||
if (IsCISOBlob(filename))
|
||||
{
|
||||
FILE* file_ = fopen(filename, "rb");
|
||||
return new CISOFileReader(file_);
|
||||
FILE* f = fopen(filename, "rb");
|
||||
return new CISOFileReader(f);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
|
|
@ -30,9 +30,9 @@ PlainFileReader::PlainFileReader(FILE* file__)
|
|||
|
||||
PlainFileReader* PlainFileReader::Create(const char* filename)
|
||||
{
|
||||
FILE* file_ = fopen(filename, "rb");
|
||||
if (file_)
|
||||
return new PlainFileReader(file_);
|
||||
FILE* f = fopen(filename, "rb");
|
||||
if (f)
|
||||
return new PlainFileReader(f);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "Frame.h"
|
||||
#include "ConfigMain.h"
|
||||
#include "PluginManager.h"
|
||||
#include "MemcardManager.h"
|
||||
#include "CheatsWindow.h"
|
||||
#include "AboutDolphin.h"
|
||||
#include "GameListCtrl.h"
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "Frame.h"
|
||||
#include "ConfigMain.h"
|
||||
#include "PluginManager.h"
|
||||
#include "MemcardManager.h"
|
||||
#include "CheatsWindow.h"
|
||||
#include "AboutDolphin.h"
|
||||
#include "GameListCtrl.h"
|
||||
|
|
|
@ -214,8 +214,9 @@ void wxLuaWindow::LuaCloseCallback(u64 userdata, int)
|
|||
}
|
||||
void wxLuaWindow::LuaStartCallback(u64 userdata, int)
|
||||
{
|
||||
int luaID = (int)userdata;
|
||||
Lua::RunLuaScriptFile(luaID, (const char *)g_contextMap[luaID]->currentScript.mb_str());
|
||||
int lid = (int)userdata;
|
||||
Lua::RunLuaScriptFile(lid,
|
||||
(const char *)g_contextMap[lid]->currentScript.mb_str());
|
||||
}
|
||||
void wxLuaWindow::LuaStopCallback(u64 userdata, int)
|
||||
{
|
||||
|
|
|
@ -61,6 +61,7 @@ if sys.platform == 'win32':
|
|||
files += [ "stdafx.cpp" ]
|
||||
elif sys.platform == 'darwin':
|
||||
ldflags += [ '-Wl,-pagezero_size,0x1000' ]
|
||||
ldflags += [ '-Wl,-ObjC' ] # XXX Hack to include wxGLCanvas
|
||||
libs += [ 'iconv' ]
|
||||
exe = '#' + env['prefix'] + '/Dolphin.app/Contents/MacOS/Dolphin'
|
||||
|
||||
|
|
|
@ -76,8 +76,8 @@ void DeviceElementDebugPrint(const void *value, void *context)
|
|||
}
|
||||
|
||||
c_type.append(" ");
|
||||
NSLog(@"%s%s%spage: 0x%x usage: 0x%x name: %s "
|
||||
"lmin: %i lmax: %i pmin: %i pmax: %i",
|
||||
NSLog(@"%s%s%spage: 0x%x usage: 0x%x name: %@ "
|
||||
"lmin: %ld lmax: %ld pmin: %ld pmax: %ld",
|
||||
type.c_str(),
|
||||
type == "collection" ? ":" : "",
|
||||
type == "collection" ? c_type.c_str() : " ",
|
||||
|
|
|
@ -27,8 +27,6 @@ static volatile struct
|
|||
u32 fbHeight;
|
||||
} s_beginFieldArgs;
|
||||
|
||||
static volatile EFBAccessType s_AccessEFBType;
|
||||
|
||||
static struct
|
||||
{
|
||||
EFBAccessType type;
|
||||
|
|
|
@ -276,8 +276,8 @@ void DVProfWrite(const char* pfilename, u32 frames)
|
|||
uTotal[1] += iter->second.uInclusive;
|
||||
}
|
||||
|
||||
fprintf(f, "total times (%d): ex: %Lu ", frames, 1000000 * uTotal[0] / (luPerfFreq*(u64)frames));
|
||||
fprintf(f, "inc: %Lu\n", 1000000 * uTotal[1]/(luPerfFreq*(u64)frames));
|
||||
fprintf(f, "total times (%d): ex: %llu ", frames, 1000000 * uTotal[0] / (luPerfFreq*(u64)frames));
|
||||
fprintf(f, "inc: %llu\n", 1000000 * uTotal[1]/(luPerfFreq*(u64)frames));
|
||||
|
||||
fiTotalTime[0] = 1.0 / (double)uTotal[0];
|
||||
fiTotalTime[1] = 1.0 / (double)uTotal[1];
|
||||
|
|
|
@ -93,8 +93,8 @@ public:
|
|||
virtual TargetRectangle ConvertEFBRectangle(const EFBRectangle& rc) = 0;
|
||||
|
||||
// Use this to upscale native EFB coordinates to IDEAL internal resolution
|
||||
static int EFBToScaledX(int x) { return x * GetTargetWidth() / EFB_WIDTH; }
|
||||
static int EFBToScaledY(int y) { return y * GetTargetHeight() / EFB_HEIGHT; }
|
||||
static unsigned int EFBToScaledX(int x) { return x * GetTargetWidth() / EFB_WIDTH; }
|
||||
static unsigned int EFBToScaledY(int y) { return y * GetTargetHeight() / EFB_HEIGHT; }
|
||||
|
||||
// Floating point versions of the above - only use them if really necessary
|
||||
static float EFBToScaledXf(float x) { return x * ((float)GetTargetWidth() / (float)EFB_WIDTH); }
|
||||
|
|
Loading…
Reference in New Issue