Pull upstream changes from TELY UI
This commit is contained in:
1 parent
7147ad52a2
commit
d5c98d5288
20 files changed
+17900
-10682
No files matched your search
@@ -28,7 +28,7 @@ static void AppendCppFileLineByLine(DN_Str8Builder *dest, DN_Str8 cpp_path)
|
||||
{
|
||||
DN_TcScratch scratch = DN_TcScratchBeginArena(&dest->arena, 1);
|
||||
DN_ErrSink *err = DN_TcErrSinkBeginDefault();
|
||||
DN_Str8 buffer = DN_OS_FileReadAllArena(&scratch.arena, cpp_path, err);
|
||||
DN_Str8 buffer = DN_Os_FileReadAllArena(&scratch.arena, cpp_path, err);
|
||||
DN_ErrSinkEndExitIfErrorF(err, -1, "Failed to load file from '%S' for appending", cpp_path);
|
||||
|
||||
bool inside_clangd_preprocessor_block = false;
|
||||
@@ -93,14 +93,14 @@ int main(int argc, char **argv)
|
||||
DN_Init(&dn, DN_InitFlags_OS, DN_TcInitArgsDefault());
|
||||
|
||||
if (argc != 3) {
|
||||
DN_OS_PrintErrF("USAGE: %s <path/to/dn/Source> <output_dir>", argv[0]);
|
||||
DN_Os_PrintErrF("USAGE: %s <path/to/dn/Source> <output_dir>", argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
DN_Str8 dn_root_dir = DN_Str8FromCStr8(argv[1]);
|
||||
DN_Str8 output_dir = DN_Str8FromCStr8(argv[2]);
|
||||
if (!DN_OS_PathMakeDir(output_dir)) {
|
||||
DN_OS_PrintErrF("Failed to make requested output directory: %S", output_dir);
|
||||
if (!DN_Os_PathMakeDir(output_dir)) {
|
||||
DN_Os_PrintErrF("Failed to make requested output directory: %S", output_dir);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -117,13 +117,13 @@ int main(int argc, char **argv)
|
||||
AppendCppFileLineByLine(&builder, path);
|
||||
}
|
||||
|
||||
DN_Date date = DN_OS_DateLocalTimeNow();
|
||||
DN_Date date = DN_Os_DateLocalTimeNow();
|
||||
DN_Str8BuilderPrependF(&builder, "// Generated by the DN single header generator %04u-%02u-%02u %02u:%02u:%02u\n\n", date.year, date.month, date.day, date.hour, date.minutes, date.seconds);
|
||||
|
||||
DN_Str8 buffer = DN_Str8TrimWhitespaceAround(DN_Str8FromStr8BuilderArena(&builder, &scratch.arena));
|
||||
DN_Str8 single_header_path = DN_Str8PathFmtOsArena(&scratch.arena, "%S/dn_single_header.%S", output_dir, suffix).value;
|
||||
DN_ErrSink *err = DN_TcErrSinkBeginDefault();
|
||||
DN_OS_FileWriteAllSafe(single_header_path, buffer, err);
|
||||
DN_Os_FileWriteAllSafe(single_header_path, buffer, err);
|
||||
DN_ErrSinkEndExitIfErrorF(err, -1, "Failed to write Single header file '%S'", single_header_path);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user