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