Fixed stdc errors

This commit is contained in:
David Anderson 2004-09-11 21:55:33 +00:00
parent 77fffb46b2
commit 9922b5016f
3 changed files with 4 additions and 15 deletions

View File

@ -2688,8 +2688,6 @@ void ValidateMacros_DontCallThis_Smiley()
}
#endif
#ifdef MEMORY_TEST
/************* MEMORY *************/
// undef all defined macros
#undef new
@ -2803,7 +2801,7 @@ void *operator new(size_t reportedSize)
return ptr;
// allocation failed
throw std::bad_alloc();
return NULL;
}
void *operator new[](size_t reportedSize)
@ -2816,7 +2814,7 @@ void *operator new[](size_t reportedSize)
return ptr;
// allocation failed
throw std::bad_alloc();
return NULL;
}
// Microsoft memory tracking operators
@ -2830,7 +2828,7 @@ void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine)
return ptr;
// allocation failed
throw std::bad_alloc();
return NULL;
}
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
{
@ -2842,7 +2840,7 @@ void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine
return ptr;
// allocation failed
throw std::bad_alloc();
return NULL;
}
void operator delete(void *reportedAddress)
@ -2861,8 +2859,6 @@ void operator delete[](void *reportedAddress)
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
}
#endif //MEMORY_TEST
/************* stuff from dlls/util.cpp *************/
// must come here because cbase.h declares it's own operator new

View File

@ -2135,8 +2135,6 @@ void MF_Log(const char *fmt, ...);
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
#define MF_Format g_fn_Format;
#ifdef MEMORY_TEST
/*** Memory ***/
void *operator new(size_t reportedSize);
void *operator new[](size_t reportedSize);
@ -2180,6 +2178,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
#endif //MEMORY_TEST
#endif // #ifndef __AMXXMODULE_H__

View File

@ -18,9 +18,6 @@
#define MODULE_DATE "Unknown"
#endif // __DATE__
// looking for mem leaks?
// #define MEMORY_TEST
// metamod plugin?
// #define USE_METAMOD