moved enum handling code to separate files

This commit is contained in:
Nikita Smith
2025-01-08 03:24:35 -08:00
parent 3961f93d1a
commit b6b64be867
13 changed files with 1398 additions and 2907 deletions
+34
View File
@@ -0,0 +1,34 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
internal String8
mscrt_string_from_eh_adjectives(Arena *arena, MSCRT_EhHandlerTypeFlags adjectives)
{
Temp scratch = scratch_begin(&arena, 1);
String8List adj_list = {0};
if (adjectives & MSCRT_EhHandlerTypeFlag_IsConst) {
str8_list_pushf(scratch.arena, &adj_list, "Const");
}
if (adjectives & MSCRT_EhHandlerTypeFlag_IsVolatile) {
str8_list_pushf(scratch.arena, &adj_list, "Volatile");
}
if (adjectives & MSCRT_EhHandlerTypeFlag_IsUnaligned) {
str8_list_pushf(scratch.arena, &adj_list, "Unaligned");
}
if (adjectives & MSCRT_EhHandlerTypeFlag_IsReference) {
str8_list_pushf(scratch.arena, &adj_list, "Reference");
}
if (adjectives & MSCRT_EhHandlerTypeFlag_IsResumable) {
str8_list_pushf(scratch.arena, &adj_list, "Resumable");
}
if (adjectives & MSCRT_EhHandlerTypeFlag_IsStdDotDot) {
str8_list_pushf(scratch.arena, &adj_list, "StdDotDot");
}
if (adjectives & MSCRT_EhHandlerTypeFlag_IsComplusEH) {
str8_list_pushf(scratch.arena, &adj_list, "ComplusEH");
}
String8 result = str8_list_join(arena, &adj_list, &(StringJoin){.sep=str8_lit(", ")});
scratch_end(scratch);
return result;
}
+9
View File
@@ -0,0 +1,9 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef MSVC_CRT_ENUM_H
#define MSVC_CRT_ENUM_H
internal String8 mscrt_string_from_eh_adjectives(Arena *arena, MSCRT_EhHandlerTypeFlags adjectives);
#endif // MSVC_CRT_ENUM_H