SDL_test_memory.c: fix build against older windows SDKs.

This commit is contained in:
Ozkan Sezer 2023-11-02 20:33:02 +03:00 committed by Ozkan Sezer
parent 618d15bce6
commit 338974bb29
1 changed files with 5 additions and 1 deletions

View File

@ -43,6 +43,10 @@ typedef BOOL (__stdcall *dbghelp_SymGetLineFromAddr_fn)(HANDLE hProcess, DWORD q
#endif
static dbghelp_SymGetLineFromAddr_fn dbghelp_SymGetLineFromAddr;
/* older SDKs might not have this: */
__declspec(dllimport) USHORT WINAPI RtlCaptureStackBackTrace(ULONG FramesToSkip, ULONG FramesToCapture, PVOID* BackTrace, PULONG BackTraceHash);
#define CaptureStackBackTrace RtlCaptureStackBackTrace
#endif
/* This is a simple tracking allocator to demonstrate the use of SDL's
@ -179,7 +183,7 @@ static void SDL_TrackAllocation(void *mem, size_t size)
line.LineNumber = 0;
}
SDL_snprintf(entry->stack_names[i], sizeof(entry->stack_names[i]), "%s+0x%llx %s:%u", pSymbol->Name, (unsigned long long)dwDisplacement, line.FileName, (Uint32)line.LineNumber);
SDL_snprintf(entry->stack_names[i], sizeof(entry->stack_names[i]), "%s+0x%I64x %s:%u", pSymbol->Name, dwDisplacement, line.FileName, (Uint32)line.LineNumber);
}
}
}