Get latest changes from LPP bot

This commit is contained in:
2025-06-03 16:26:40 +10:00
parent 2371297dda
commit b1394e6416
29 changed files with 2644 additions and 290 deletions
+2 -2
View File
@@ -55,12 +55,12 @@ DN_API void DN_Core_Init(DN_Core *core, DN_CoreOnInit on_init)
DN_MSVC_WARNING_POP
DN_USize longest_feature_name = 0;
DN_ForIndexU(feature_index, DN_CPUFeature_Count) {
for (DN_ForIndexU(feature_index, DN_CPUFeature_Count)) {
DN_CPUFeatureDecl feature_decl = g_dn_cpu_feature_decl[feature_index];
longest_feature_name = DN_Max(longest_feature_name, feature_decl.label.size);
}
DN_ForIndexU(feature_index, DN_CPUFeature_Count) {
for (DN_ForIndexU(feature_index, DN_CPUFeature_Count)) {
DN_CPUFeatureDecl feature_decl = g_dn_cpu_feature_decl[feature_index];
bool has_feature = DN_CPU_HasFeature(report, feature_decl.value);
DN_Str8Builder_AppendF(&builder,
+6 -5
View File
@@ -13,12 +13,13 @@ DN_API DN_StackTraceWalkResult DN_StackTrace_Walk(DN_Arena *arena, uint16_t limi
HANDLE thread = GetCurrentThread();
result.process = GetCurrentProcess();
if (!g_dn_os_core_->win32_sym_initialised) {
g_dn_os_core_->win32_sym_initialised = true;
DN_W32Core *w32 = DN_OS_GetW32Core_();
if (!w32->sym_initialised) {
w32->sym_initialised = true;
SymSetOptions(SYMOPT_LOAD_LINES);
if (!SymInitialize(result.process, nullptr /*UserSearchPath*/, true /*fInvadeProcess*/)) {
DN_OSTLSTMem tmem = DN_OS_TLSTMem(arena);
DN_WinError error = DN_Win_LastError(tmem.arena);
DN_W32Error error = DN_W32_LastError(tmem.arena);
DN_LOG_ErrorF("SymInitialize failed, stack trace can not be generated (%lu): %.*s\n", error.code, DN_STR_FMT(error.msg));
}
}
@@ -177,8 +178,8 @@ DN_API DN_StackTraceFrame DN_StackTrace_RawFrameToFrame(DN_Arena *arena, DN_Stac
DN_StackTraceFrame result = {};
result.address = raw_frame.base_addr;
result.line_number = line.LineNumber;
result.file_name = DN_Win_Str16ToStr8(arena, file_name16);
result.function_name = DN_Win_Str16ToStr8(arena, function_name16);
result.file_name = DN_W32_Str16ToStr8(arena, file_name16);
result.function_name = DN_W32_Str16ToStr8(arena, function_name16);
if (!DN_Str8_HasData(result.function_name))
result.function_name = DN_STR8("<unknown function>");
+13 -13
View File
@@ -403,10 +403,10 @@ void DN_Docs_Demo()
}
}
// NOTE: DN_LogProc ///////////////////////////////////////////////////////////////////////////
// NOTE: DN_LOGProc ///////////////////////////////////////////////////////////////////////////
//
// Function prototype of the logging interface exposed by this library. Logs
// emitted using the DN_Log_* family of functions are routed through this
// emitted using the DN_LOG_* family of functions are routed through this
// routine.
// NOTE: DN_FNV1A /////////////////////////////////////////////////////////////////////////////
@@ -660,7 +660,7 @@ void DN_Docs_Demo()
// returned in add and multiply operations, and, the minimum is returned in
// subtraction and division.
// NOTE: DN_Safe_SaturateCast* ////////////////////////////////////////////////////////////////
// NOTE: DN_SaturateCast* ////////////////////////////////////////////////////////////////
//
// Truncate the passed in value to the return type clamping the resulting
// value to the max value of the desired data type. It DN_Check's the
@@ -1175,31 +1175,31 @@ void DN_Docs_Demo()
DN_VArray_Deinit(&array);
}
// NOTE: DN_Win_LastError /////////////////////////////////////////////////////////////
// NOTE: DN_Win_ErrorCodeToMsg /////////////////////////////////////////////////////////////
// NOTE: DN_W32_LastError /////////////////////////////////////////////////////////////
// NOTE: DN_W32_ErrorCodeToMsg /////////////////////////////////////////////////////////////
#if defined(DN_PLATFORM_WIN32)
if (0) {
// Generate the error string for the last Win32 API called that return
// an error value.
DN_OSTLSTMem tmem = DN_OS_TLSTMem(nullptr);
DN_WinError get_last_error = DN_Win_LastError(tmem.arena);
DN_W32Error get_last_error = DN_W32_LastError(tmem.arena);
printf("Error (%lu): %.*s", get_last_error.code, DN_STR_FMT(get_last_error.msg));
// Alternatively, pass in the error code directly
DN_WinError error_msg_for_code = DN_Win_ErrorCodeToMsg(tmem.arena, /*error_code*/ 0);
DN_W32Error error_msg_for_code = DN_W32_ErrorCodeToMsg(tmem.arena, /*error_code*/ 0);
printf("Error (%lu): %.*s", error_msg_for_code.code, DN_STR_FMT(error_msg_for_code.msg));
}
// NOTE: DN_Win_MakeProcessDPIAware ///////////////////////////////////////////////////////////
// NOTE: DN_W32_MakeProcessDPIAware ///////////////////////////////////////////////////////////
//
// Call once at application start-up to ensure that the application is DPI
// aware on Windows and ensure that application UI is scaled up
// appropriately for the monitor.
// NOTE: DN_Win_Str8ToStr16 /////////////////////////////////////////////////////////////
// NOTE: DN_Win_Str8ToStr16Buffer /////////////////////////////////////////////////////////////
// NOTE: DN_Win_Str16ToStr8 /////////////////////////////////////////////////////////////
// NOTE: DN_Win_Str16ToStr8Buffer /////////////////////////////////////////////////////////////
// NOTE: DN_W32_Str8ToStr16 /////////////////////////////////////////////////////////////
// NOTE: DN_W32_Str8ToStr16Buffer /////////////////////////////////////////////////////////////
// NOTE: DN_W32_Str16ToStr8 /////////////////////////////////////////////////////////////
// NOTE: DN_W32_Str16ToStr8Buffer /////////////////////////////////////////////////////////////
//
// Convert a UTF8 <-> UTF16 string.
//
@@ -1211,7 +1211,7 @@ void DN_Docs_Demo()
//
// Returns the number of u8's (for UTF16->8) OR u16's (for UTF8->16)
// written/required for conversion. 0 if there was a conversion error and can be
// queried using 'DN_Win_LastError'
// queried using 'DN_W32_LastError'
#endif
}