Fix linux build and a crash. hrm, how did it work before...
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@146 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
f46c64c02f
commit
ac366022f4
|
@ -22,7 +22,7 @@
|
|||
|
||||
namespace
|
||||
{
|
||||
PanicAlertHandler panic_handler = 0;
|
||||
static PanicAlertHandler panic_handler = 0;
|
||||
}
|
||||
|
||||
void RegisterPanicAlertHandler(PanicAlertHandler handler)
|
||||
|
|
|
@ -46,7 +46,7 @@ extern "C" {
|
|||
#define MAX_PATH 260
|
||||
#define WEAK_SYMBOL __attribute__((weak))
|
||||
#define stricmp strcasecmp
|
||||
#define Crash() {__builtin_trap();}
|
||||
#define Crash() {asm ("int $3");}
|
||||
// #ifdef 64bit
|
||||
// #define _M_IX86
|
||||
// #else
|
||||
|
|
|
@ -162,7 +162,7 @@ void StringFromFormatV(std::string* out, const char* format, va_list args)
|
|||
|
||||
while (writtenCount < 0)
|
||||
{
|
||||
delete[] buf;
|
||||
delete [] buf;
|
||||
buf = new char[newSize + 1];
|
||||
writtenCount = vsnprintf(buf, newSize, format, args);
|
||||
newSize *= 2;
|
||||
|
|
|
@ -23,6 +23,8 @@ namespace Gen
|
|||
{
|
||||
static u8 *code;
|
||||
static bool mode32 = false;
|
||||
static bool enableBranchHints = false;
|
||||
|
||||
|
||||
void SetCodePtr(u8 *ptr)
|
||||
{
|
||||
|
@ -350,8 +352,6 @@ namespace Gen
|
|||
return branch;
|
||||
}
|
||||
|
||||
static bool enableBranchHints = false;
|
||||
|
||||
// These are to be used with Jcc only.
|
||||
// Found in intel manual 2A
|
||||
// These do not really make a difference for any current X86 CPU,
|
||||
|
@ -1221,10 +1221,12 @@ namespace Gen
|
|||
#ifdef _M_IX86
|
||||
// Don't really need to do anything
|
||||
#elif defined(_M_X64)
|
||||
#if _WIN32
|
||||
int stacksize = ((maxCallParams+1)&~1)*8 + 8;
|
||||
// Set up a stack frame so that we can call functions
|
||||
// TODO: use maxCallParams
|
||||
SUB(64, R(RSP), Imm8(stacksize));
|
||||
#endif
|
||||
#else
|
||||
#error Arch not supported
|
||||
#endif
|
||||
|
@ -1234,15 +1236,17 @@ namespace Gen
|
|||
#ifdef _M_IX86
|
||||
RET();
|
||||
#elif defined(_M_X64)
|
||||
#ifdef _WIN32
|
||||
int stacksize = ((maxCallParams+1)&~1)*8 + 8;
|
||||
ADD(64, R(RSP), Imm8(stacksize));
|
||||
#endif
|
||||
RET();
|
||||
#else
|
||||
#error Arch not supported
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
// helper routines for setting pointers
|
||||
|
|
|
@ -198,4 +198,5 @@ struct Viewport
|
|||
extern XFRegisters xfregs;
|
||||
extern u32 xfmem[XFMEM_SIZE];
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -99,13 +99,14 @@ struct RECT
|
|||
#endif
|
||||
|
||||
// several macros
|
||||
// PLEASE DO NOT USE THE FOLLOWING SAFE*
|
||||
// They only encourage sloppy coding, and hides bugs.
|
||||
#ifndef SAFE_DELETE_ARRAY
|
||||
#define SAFE_DELETE_ARRAY(x) if( (x) != NULL ) { delete[] (x); (x) = NULL; }
|
||||
#endif
|
||||
#ifndef SAFE_RELEASE
|
||||
#define SAFE_RELEASE(x) if( (x) != NULL ) { (x)->Release(); (x) = NULL; }
|
||||
#endif
|
||||
|
||||
#define SAFE_RELEASE_CGPROG(x) { if( (x) != NULL ) { cgDestroyProgram(x); x = NULL; } }
|
||||
#define SAFE_RELEASE_PROG(x) { if( (x) != 0 ) { glDeleteProgramsARB(1, &(x)); x = 0; } }
|
||||
#define SAFE_RELEASE_TEX(x) { if( (x) != 0 ) { glDeleteTextures(1, &(x)); x = 0; } }
|
||||
|
|
|
@ -80,7 +80,7 @@ void TextureMngr::TCacheEntry::SetTextureParameters(TexMode0& newmode)
|
|||
|
||||
void TextureMngr::TCacheEntry::Destroy()
|
||||
{
|
||||
SAFE_RELEASE_TEX((GLuint)texture);
|
||||
SAFE_RELEASE_TEX(texture);
|
||||
}
|
||||
|
||||
void TextureMngr::Init()
|
||||
|
|
|
@ -85,3 +85,4 @@ public:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue