move debug code defines into header

This commit is contained in:
FunkyFr3sh 2024-06-22 01:19:25 +02:00
parent 12715febe9
commit c86b6f01a2
13 changed files with 44 additions and 101 deletions

View file

@ -3,6 +3,7 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <intrin.h>
LONG WINAPI dbg_exception_handler(EXCEPTION_POINTERS* exception);
void dbg_counter_start();
@ -31,6 +32,15 @@ extern double g_dbg_frame_time;
extern DWORD g_dbg_frame_count;
extern LPTOP_LEVEL_EXCEPTION_FILTER g_dbg_exception_filter;
#if defined(__GNUC__) /* wrap msvc intrinsics onto gcc builtins */
#undef _ReturnAddress
#undef _AddressOfReturnAddress
#define _ReturnAddress() __builtin_return_address(0)
#define _AddressOfReturnAddress() __builtin_frame_address (0)
#else
#pragma intrinsic(_ReturnAddress)
#endif /* __GNUC__ */
//#define _DEBUG 1
/* use OutputDebugStringA rather than printf */