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