Built-in procedure #defined
This commit is contained in:
1 parent
5c608b01ba
commit
2ddb27869b
6 files changed
+105
-32
No files matched your search
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user