From 360160b88f35b331f7fdb67264bb16402e34000b Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Wed, 12 Feb 2025 19:46:55 -0500 Subject: [SharedCache] Remove designator initialization Fixes MSVC C++17 failing to compile, hopefully. --- view/sharedcache/api/sharedcacheapi.h | 79 ++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 38 deletions(-) (limited to 'view/sharedcache/api/sharedcacheapi.h') diff --git a/view/sharedcache/api/sharedcacheapi.h b/view/sharedcache/api/sharedcacheapi.h index ec64ef10..50d2b382 100644 --- a/view/sharedcache/api/sharedcacheapi.h +++ b/view/sharedcache/api/sharedcacheapi.h @@ -139,7 +139,7 @@ namespace SharedCacheAPI { std::string installName; std::vector> entryPoints; - std::vector m_entryPoints; //list of entrypoints + std::vector m_entryPoints; // list of entrypoints symtab_command symtab; dysymtab_command dysymtab; @@ -152,7 +152,7 @@ namespace SharedCacheAPI { uint64_t relocationBase; // Section and program headers, internally use 64-bit form as it is a superset of 32-bit - std::vector segments; //only three types of sections __TEXT, __DATA, __IMPORT + std::vector segments; // only three types of sections __TEXT, __DATA, __IMPORT segment_command_64 linkeditSegment; std::vector sections; std::vector sectionNames; @@ -167,6 +167,7 @@ namespace SharedCacheAPI { std::string exportTriePath; + bool linkeditPresent = false; bool dysymPresent = false; bool dyldInfoPresent = false; bool exportTriePresent = false; @@ -186,7 +187,7 @@ namespace SharedCacheAPI { MSS_SUBCLASS(symtab); MSS_SUBCLASS(dysymtab); MSS_SUBCLASS(dyldInfo); - // MSS_SUBCLASS(routines64); + MSS_SUBCLASS(routines64); MSS_SUBCLASS(functionStarts); MSS_SUBCLASS(moduleInitSections); MSS_SUBCLASS(exportTrie); @@ -202,6 +203,7 @@ namespace SharedCacheAPI { MSS_SUBCLASS(buildVersion); MSS_SUBCLASS(buildToolVersions); MSS(exportTriePath); + MSS(linkeditPresent); MSS(dysymPresent); MSS(dyldInfoPresent); MSS(exportTriePresent); @@ -212,41 +214,42 @@ namespace SharedCacheAPI { } static SharedCacheMachOHeader Load(SharedCacheCore::DeserializationContext& context) { - return SharedCacheMachOHeader { - .MSL(textBase), - .MSL(loadCommandOffset), - .MSL(ident), - .MSL(identifierPrefix), - .MSL(installName), - .MSL(entryPoints), - .MSL(m_entryPoints), - .MSL(symtab), - .MSL(dysymtab), - .MSL(dyldInfo), - // .MSL(routines64), // FIXME CRASH but also do we even use this? - .MSL(functionStarts), - .MSL(moduleInitSections), - .MSL(exportTrie), - .MSL(chainedFixups), - .MSL(relocationBase), - .MSL(segments), - .MSL(linkeditSegment), - .MSL(sections), - .MSL(sectionNames), - .MSL(symbolStubSections), - .MSL(symbolPointerSections), - .MSL(dylibs), - .MSL(buildVersion), - .MSL(buildToolVersions), - .MSL(exportTriePath), - .MSL(dysymPresent), - .MSL(dyldInfoPresent), - .MSL(exportTriePresent), - .MSL(chainedFixupsPresent), - // .MSL(routinesPresent), - .MSL(functionStartsPresent), - .MSL(relocatable), - }; + SharedCacheMachOHeader header; + header.MSL(textBase); + header.MSL(loadCommandOffset); + header.MSL(ident); + header.MSL(identifierPrefix); + header.MSL(installName); + header.MSL(entryPoints); + header.MSL(m_entryPoints); + header.MSL(symtab); + header.MSL(dysymtab); + header.MSL(dyldInfo); + header.MSL(routines64); + header.MSL(functionStarts); + header.MSL(moduleInitSections); + header.MSL(exportTrie); + header.MSL(chainedFixups); + header.MSL(relocationBase); + header.MSL(segments); + header.MSL(linkeditSegment); + header.MSL(sections); + header.MSL(sectionNames); + header.MSL(symbolStubSections); + header.MSL(symbolPointerSections); + header.MSL(dylibs); + header.MSL(buildVersion); + header.MSL(buildToolVersions); + header.MSL(exportTriePath); + header.MSL(linkeditPresent); + header.MSL(dysymPresent); + header.MSL(dyldInfoPresent); + header.MSL(exportTriePresent); + header.MSL(chainedFixupsPresent); + header.MSL(routinesPresent); + header.MSL(functionStartsPresent); + header.MSL(relocatable); + return header; } }; -- cgit v1.3.1