Files
wehub-resource-sync e7738de6d2
CI / Deep Native Runtime Cases (1/6) (push) Has been skipped
CI / Native Preflight (push) Failing after 1s
CI / Native Runtime Cases (1/2) (push) Failing after 0s
CI / Native Runtime Cases (2/2) (push) Failing after 1s
CI / Native Metadata Reports (push) Failing after 0s
CI / Native Direct Backend Artifacts (push) Failing after 0s
CI / Native Sanitizer Smoke (push) Failing after 1s
CI / Command Contract Snapshots (push) Failing after 1s
CI / Deep Conformance Suite (push) Has been skipped
CI / Graph Build Perf (push) Failing after 1s
CI / Deep Native Preflight (push) Has been skipped
CI / Deep Native Runtime Cases (2/6) (push) Has been skipped
CI / Deep Native Runtime Cases (3/6) (push) Has been skipped
CI / Conformance Suite (push) Failing after 1s
CI / Workspace Checks (push) Failing after 0s
CI / Deep Native Runtime Cases (5/6) (push) Has been skipped
CI / Deep Native Runtime Cases (6/6) (push) Has been skipped
CI / Deep Native Runtime Cases (4/6) (push) Has been skipped
CI / Deep Graph Build Perf (push) Has been skipped
chore: import upstream snapshot with attribution
2026-07-13 12:29:30 +08:00

25 lines
1.0 KiB
C

#ifndef ZERO_C_DIRECT_EMIT_H
#define ZERO_C_DIRECT_EMIT_H
#include "zero.h"
#include <stdio.h>
static inline bool z_direct_exe_reject_c_import_calls(const IrProgram *program, ZDiag *diag, const char *backend_name) {
if (!program || program->direct_c_import_call_count == 0) return true;
const char *symbol = (program->external_function_len > 0 && program->external_functions[0].symbol) ? program->external_functions[0].symbol : "extern C call";
if (diag) {
diag->code = 4004;
diag->line = 1;
diag->column = 1;
diag->length = 1;
snprintf(diag->message, sizeof(diag->message), "direct %s executable backend requires object emission and an explicit link step for extern C calls", backend_name ? backend_name : "native");
snprintf(diag->expected, sizeof(diag->expected), "direct executable without extern C calls");
snprintf(diag->actual, sizeof(diag->actual), "%s", symbol);
snprintf(diag->help, sizeof(diag->help), "emit an object and link it with the required C libraries");
}
return false;
}
#endif