mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-21 20:59:09 +00:00
Fixes to CoreLib and CoreLibExe.
This commit is contained in:
@ -56,7 +56,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
***/
|
||||
|
||||
static bool s_skipBreak;
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
static CCritSect * s_critsect;
|
||||
#endif
|
||||
|
||||
// User options
|
||||
static bool s_options[kNumErrorOptions];
|
||||
@ -69,12 +71,14 @@ static bool s_options[kNumErrorOptions];
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
AUTO_INIT_FUNC(hsExeErrorInit) {
|
||||
// The critical section has to be initialized
|
||||
// before program startup and never freed
|
||||
static byte rawMemory[sizeof(CCritSect)];
|
||||
s_critsect = new(rawMemory) CCritSect;
|
||||
}
|
||||
#endif
|
||||
|
||||
//============================================================================
|
||||
static void DoAssert (int line, const char file[], const char msg[]) {
|
||||
@ -118,7 +122,7 @@ static void DoAssert (int line, const char file[], const char msg[]) {
|
||||
|
||||
//============================================================================
|
||||
#pragma auto_inline(off)
|
||||
void __cdecl ErrorFatal (int line, const char file[], const char fmt[], ...) {
|
||||
void CDECL ErrorFatal (int line, const char file[], const char fmt[], ...) {
|
||||
char buffer[256];
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
@ -135,7 +139,7 @@ void __cdecl ErrorFatal (int line, const char file[], const char fmt[], ...) {
|
||||
|
||||
//============================================================================
|
||||
#pragma auto_inline(off)
|
||||
void __cdecl ErrorAssert (int line, const char file[], const char fmt[], ...) {
|
||||
void CDECL ErrorAssert (int line, const char file[], const char fmt[], ...) {
|
||||
char buffer[256];
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
@ -250,7 +254,7 @@ void DebugMsgV (const char fmt[], va_list args) {
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void __cdecl DebugMsg (const char fmt[], ...) {
|
||||
void CDECL DebugMsg (const char fmt[], ...) {
|
||||
#ifdef HS_DEBUGGING
|
||||
|
||||
va_list args;
|
||||
|
@ -591,14 +591,16 @@ void * MemRealloc (void * ptr, unsigned bytes, unsigned flags, const char file[]
|
||||
//===========================================================================
|
||||
unsigned MemSize (void * ptr) {
|
||||
ASSERT(ptr);
|
||||
unsigned result;
|
||||
unsigned result = 0;
|
||||
|
||||
#ifdef MEM_DEBUG
|
||||
const _CrtMemBlockHeader * pHead = pHdr(ptr);
|
||||
unsigned block = pHead->nBlockUse;
|
||||
#endif
|
||||
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
result = (unsigned)_msize_dbg(ptr, block);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user