Deprecated '&' macro arguments.

This commit is contained in:
Christoffer Lerno
2025-01-08 22:13:49 +01:00
parent 9412b58d80
commit 8e0d6d11b9
24 changed files with 288 additions and 304 deletions

View File

@@ -1,14 +1,14 @@
module test;
import libc;
import std::io;
<*
@require values::@assign_to(*b, *a) && values::@assign_to(*a, *b)
@require $defined(#a = #b, #b = #a)
*>
macro void @swap(&a, &b)
macro void @swap(#a, #b)
{
var temp = *a;
*a = *b;
*b = temp;
var temp = #a;
#a = #b;
#b = temp;
}
fn void main()
@@ -16,5 +16,5 @@ fn void main()
int x = 123;
int y = 456;
@swap(x, y);
libc::printf("x: %d y: %d\n", x, y);
io::printfn("x: %d y: %d", x, y);
}