The following code:
inline void * __cdecl operator new(unsigned int size,
const char *file, int line)
void *ptr = (void *)malloc(size);
AddTrack((DWORD)ptr, size, file, line);
error: declaration of `operator new' as non-function
Okay, I managed to eliminate that problem by commenting out the following in a header file (yes, if you haven't noticed, I'm using the example code from this):
BUT I want to be able to #include this file and have it override the new operator with that macro to make it spew out some diagnostics. How do I do that?
#define DEBUG_NEW new(__FILE__, __LINE__)
#define new DEBUG_NEW
Problem solved by sticking the function definitions above the macro.