mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
14 lines
280 B
C
14 lines
280 B
C
module testing;
|
|
import std::io;
|
|
|
|
macro char[] read(src, Allocator* allocator, n)
|
|
{
|
|
char* data = allocator.alloc_checked(n)!; // #error: Rethrow is only allowed in macros
|
|
io::read_all(src, data[:n])!;
|
|
}
|
|
|
|
fn void main()
|
|
{
|
|
ByteReader br;
|
|
read(&br, mem::temp(), 10);
|
|
} |