From feeb86d046d55d197040c7061e39198c80373ecb Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 15 Aug 2022 14:52:15 +0200 Subject: #when --- examples/hello-world.cff | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'examples/hello-world.cff') diff --git a/examples/hello-world.cff b/examples/hello-world.cff index d127b96..6266246 100644 --- a/examples/hello-world.cff +++ b/examples/hello-world.cff @@ -1,8 +1,13 @@ - extern fn printf(fmt *const u8, ...) int; -extern fn printf2(fmt *const u8, ...) int; -extern fn main(argc int, argc *const *const u8) int { - "hello world\n"; +#when sizeof *void == 8 { +def str = "hello 64-bit"; +} +#when sizeof *void == 4 { +def str = "hello 32-bit"; +} + +extern fn main(argc int, argv *const *const u8) int { + printf(str ## "\n"); } -- cgit v1.2.3