From 0c217ebbe96d534ca75e3752cda37646d63589a8 Mon Sep 17 00:00:00 2001 From: Stephen Saunders Date: Sat, 4 Mar 2023 21:06:08 -0500 Subject: [PATCH] Fix win32 compilation errors when Optick profiling is off --- neo/sys/win32/win_main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/neo/sys/win32/win_main.cpp b/neo/sys/win32/win_main.cpp index 427b447e..877b35d0 100644 --- a/neo/sys/win32/win_main.cpp +++ b/neo/sys/win32/win_main.cpp @@ -1949,6 +1949,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin Sys_SetDPIAwareness(); // Setting memory allocators +#if USE_OPTICK OPTICK_SET_MEMORY_ALLOCATOR( []( size_t size ) -> void* { return operator new( size ); }, []( void* p ) @@ -1960,6 +1961,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin /* Do some TLS initialization here if needed */ } ); +#endif #if 0 DWORD handler = ( DWORD )_except_handler; @@ -2034,7 +2036,9 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin // main game loop while( 1 ) { +#if USE_OPTICK OPTICK_FRAME( "MainThread" ); +#endif Win_Frame(); @@ -2049,7 +2053,9 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin common->Frame(); } +#if USE_OPTICK OPTICK_SHUTDOWN(); +#endif // never gets here return 0;