22
22
23
23
#include < sstream>
24
24
25
- static void LoadMetadataV1 (XmlNode , Metadata *);
26
- static void LoadCategoryV1 (XmlNode , Index *);
27
- static void LoadPackageV1 (XmlNode , Category *);
28
- static void LoadVersionV1 (XmlNode , Package *);
29
- static void LoadSourceV1 (XmlNode , Version *);
25
+ static void LoadMetadataV1 (XmlNode, Metadata *);
26
+ static void LoadCategoryV1 (XmlNode, Index *);
27
+ static void LoadPackageV1 (XmlNode, Category *);
28
+ static void LoadVersionV1 (XmlNode, Package *);
29
+ static void LoadSourceV1 (XmlNode, Version *, bool hasArm64Ec );
30
30
31
31
void Index::loadV1 (XmlNode root, Index *ri)
32
32
{
@@ -117,8 +117,21 @@ void LoadVersionV1(XmlNode verNode, Package *pkg)
117
117
118
118
XmlNode node = verNode.firstChild (" source" );
119
119
120
+ bool hasArm64Ec = false ;
121
+ #if defined(_WIN32) && defined(_M_ARM64EC)
120
122
while (node) {
121
- LoadSourceV1 (node, ver);
123
+ const char *platform = *node.attribute (" platform" );
124
+ if (platform && Platform (platform) == Platform::Windows_arm64ec) {
125
+ hasArm64Ec = true ;
126
+ break ;
127
+ }
128
+ node = node.nextSibling (" source" );
129
+ }
130
+ node = verNode.firstChild (" source" );
131
+ #endif
132
+
133
+ while (node) {
134
+ LoadSourceV1 (node, ver, hasArm64Ec);
122
135
node = node.nextSibling (" source" );
123
136
}
124
137
@@ -133,7 +146,7 @@ void LoadVersionV1(XmlNode verNode, Package *pkg)
133
146
ptr.release ();
134
147
}
135
148
136
- void LoadSourceV1 (XmlNode node, Version *ver)
149
+ void LoadSourceV1 (XmlNode node, Version *ver, const bool hasArm64Ec )
137
150
{
138
151
const XmlString &platform = node.attribute (" platform" ),
139
152
&type = node.attribute (" type" ),
@@ -146,7 +159,7 @@ void LoadSourceV1(XmlNode node, Version *ver)
146
159
std::unique_ptr<Source> ptr (src);
147
160
148
161
src->setChecksum (checksum.value_or (" " ));
149
- src->setPlatform (platform.value_or (" all" ));
162
+ src->setPlatform (Platform ( platform.value_or (" all" ), hasArm64Ec ));
150
163
src->setTypeOverride (Package::getType (type.value_or (" " )));
151
164
152
165
int sections = 0 ;
0 commit comments