AudRecordLib
|
Main precompiled header, includes project wide header files. More...
#include "macroutils.h"
#include <intrin.h>
#include <windows.h>
#include "scoped.h"
#include <string>
#include <vector>
#include "ETWEvents.h"
Go to the source code of this file.
Defines | |
#define | WIN32_LEAN_AND_MEAN |
#define | _WIN32_WINNT 0x0600 |
#define | _DO_NOT_DECLARE_INTERLOCKED_INTRINSICS_IN_MEMORY |
#define | NOMINMAX |
#define | LOG_TEXT(Function, string,...) |
#define | SEVERE_TEXT(string,...) LOG_TEXT(LogSevereEvent, string, __VA_ARGS__) |
#define | DBG_TEXT(string,...) LOG_TEXT(LogDebugEvent, string, __VA_ARGS__) |
#define | RETURN_ON_FAILED_EXP(exp) |
#define | RETURN_ON_FAILED_EXP_VOID(exp) |
Functions | |
void *__cdecl | operator new (size_t bytes) |
void *__cdecl | operator new[] (size_t bytes) |
void __cdecl | operator delete (void *ptr) |
void __cdecl | operator delete[] (void *ptr) |
Main precompiled header, includes project wide header files.
#define DBG_TEXT | ( | string, | |
... | |||
) | LOG_TEXT(LogDebugEvent, string, __VA_ARGS__) |
Equivalent to the SEVERE_TEXT macro except that it logs to the debug channel instead of the severe one.
#define LOG_TEXT | ( | Function, | |
string, | |||
... | |||
) |
DISABLE_CONST_COND() \ do \ { \ C_ASSERT(sizeof(*string) == sizeof(char)); \ char buffer[300]; \ LogFormat(buffer, __FUNCTION__ " " string "\n", __VA_ARGS__); \ Function(__FILE__, __LINE__, __FUNCTION__, buffer + ARRAYSIZE(__FUNCTION__) + 1); \ OutputDebugStringA(buffer); \ } \ while(0); \ END_DISABLE_CONST_COND()
Formats string and the additional args in a sprintf manner and outputs it to the debug stream using ODPrint() and to an ETW event stream using Function. String must be a narrow string literal, this is asserted by the macro.
#define RETURN_ON_FAILED_EXP | ( | exp | ) |
{ \
HRESULT hr = (exp); \
if(FAILED(hr)) \
{ \
DBG_TEXT(#exp " failed with error %#08x", hr); \
return hr; \
} \
}
Evaluates the expression exp which should return a HRESULT. If the expression fails (as determined by the FAILED macro) the failure is logged via the DBG_TEXT() macro and the result of the expression returned as the functions exit code
#define RETURN_ON_FAILED_EXP_VOID | ( | exp | ) |
{ \
HRESULT hr = (exp); \
if(FAILED(hr)) \
{ \
DBG_TEXT(#exp " failed with error %#08x", hr); \
return; \
} \
}
Similar to the RETURN_ON_FAILED_EXP() macro except for use in void functions where returning the HRESULT would cause compile errors
#define SEVERE_TEXT | ( | string, | |
... | |||
) | LOG_TEXT(LogSevereEvent, string, __VA_ARGS__) |
Formats string and the additional args in a sprintf manner and outputs it to the ETW event and debug streams using LogSevereEvent() and ODPrint(). String must be a narrow string literal, this is asserted by the macro
void __cdecl operator delete | ( | void * | ptr | ) |
Overloaded object deleter that frees either with free or with the user defined deleter
void __cdecl operator delete[] | ( | void * | ptr | ) |
Overloaded object array deleter that frees either with free or with the user defined deleter
void* __cdecl operator new | ( | size_t | bytes | ) |
Custom object allocator that allocates either with malloc or with the user defined allocator
void* __cdecl operator new[] | ( | size_t | bytes | ) |
Custom array allocator that allocates either with malloc or with the user defined allocator