Some minor changes to G_Assert.

This commit is contained in:
Walter Julius Hennecke 2013-12-19 22:53:08 +01:00
parent d1edc454ee
commit 2460b1c959
2 changed files with 5 additions and 5 deletions

View file

@ -1,10 +1,10 @@
#include "g_local.h"
#include "g_logger.h"
qboolean _G_Assert(void* ptr, const char* varname, const char* function) {
qboolean _G_Assert(void* ptr, const char* varname, const char* function, const char* file, int line) {
if (ptr == NULL) {
G_LocLogger(LL_ERROR, "%s == NULL!\n", varname);
G_LocLogger(LL_TRACE, "%s - End\n", function);
_G_LocLogger(file, line, LL_ERROR, "%s == NULL!\n", varname);
_G_LocLogger(file, line, LL_TRACE, "%s - End\n", function);
return qtrue;
}

View file

@ -2914,7 +2914,7 @@ typedef struct {
* @param ptr The pointer to check.
* @return Whether the pointer is NULL or not.
*/
qboolean _G_Assert(void* ptr, const char* varname, const char* function);
#define G_Assert(ptr) _G_Assert(ptr, #ptr, __FUNCTION__)
qboolean _G_Assert(void* ptr, const char* varname, const char* function, const char* file, int line);
#define G_Assert(ptr) _G_Assert(ptr, #ptr, __FUNCTION__, __FILE__, __LINE__)
#endif //_G_LOCAL_H_