Skip to content

Commit cea8c5a

Browse files
committed
make other backends error if you use C externs
1 parent 4187f63 commit cea8c5a

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

source/backends/linux86.d

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ class BackendLinux86 : CompilerBackend {
357357
);
358358
}
359359
output ~= format("sub r15, %d\n", word.params.length * 8);
360+
361+
// TODO: support more than 6 parameters
360362

361363
output ~= format("call %s\n", node.name);
362364

source/backends/rm86.d

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,10 @@ class BackendRM86 : CompilerBackend {
696696
}
697697

698698
override void CompileExtern(ExternNode node) {
699+
if (node.externType == ExternType.C) {
700+
Error(node.error, "This backend doesn't support C externs");
701+
}
702+
699703
Word word;
700704
word.raw = node.externType == ExternType.Raw;
701705
words[node.func] = word;

source/backends/uxn.d

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,11 @@ class BackendUXN : CompilerBackend {
663663
}
664664

665665
override void CompileExtern(ExternNode node) {
666+
if (node.externType == ExternType.C) {
667+
Error(node.error, "This backend doesn't support C externs");
668+
}
669+
670+
666671
Word word;
667672
word.raw = node.externType == ExternType.Raw;
668673
words[node.func] = word;

0 commit comments

Comments
 (0)