diff options
| author | gingerBill <bill@gingerbill.org> | 2018-10-27 18:44:28 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-10-27 18:44:28 +0100 |
| commit | 2ddb27869bd704d28e4704648c26b17d00ba2ff5 (patch) | |
| tree | 2059d031bcfb8d4c448448f90dada2bc85358ce2 /examples | |
| parent | 5c608b01ba8b445511690fe499b811bb2ea15dbe (diff) | |
Built-in procedure `#defined`
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/demo/demo.odin | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/demo/demo.odin b/examples/demo/demo.odin index 30c055398..3245ce1dd 100644 --- a/examples/demo/demo.odin +++ b/examples/demo/demo.odin @@ -110,6 +110,20 @@ general_stuff :: proc() { My_Struct :: struct{x: int}; #assert(My_Struct != struct{x: int}); } + + { + X :: 123; + when #defined(X) { + fmt.println("X is defined"); + } else { + fmt.println("X is not defined"); + } + when #defined(Y) { + fmt.println("Y is defined"); + } else { + fmt.println("Y is not defined"); + } + } } |