return 0;
}
-const char** __pakfire_supported_arches = NULL;
-
PAKFIRE_EXPORT const char** pakfire_supported_arches() {
- unsigned int counter = 0;
-
- if (!__pakfire_supported_arches) {
- for (const struct pakfire_arch* arch = PAKFIRE_ARCHES; arch->name; arch++) {
- __pakfire_supported_arches = reallocarray(__pakfire_supported_arches,
- counter + 2, sizeof(*__pakfire_supported_arches));
+ static const char* supported_arches[] = {
+ // x86_64
+ PAKFIRE_ARCHES[0].name,
- // Exit if the allocation failed
- if (!__pakfire_supported_arches)
- return NULL;
+ // aarch64
+ PAKFIRE_ARCHES[1].name,
- __pakfire_supported_arches[counter++] = arch->name;
- }
+ // riscv64
+ PAKFIRE_ARCHES[2].name,
// Sentinel
- if (__pakfire_supported_arches)
- __pakfire_supported_arches[counter] = NULL;
- }
+ NULL,
+ };
- return __pakfire_supported_arches;
+ return supported_arches;
}
const char* pakfire_arch_platform(const char* name) {