diff options
| author | Mustafa Quraish <[email protected]> | 2022-02-05 02:07:25 -0500 |
|---|---|---|
| committer | Mustafa Quraish <[email protected]> | 2022-02-05 08:56:15 -0500 |
| commit | c096eb37487295610ff43825163d676b35799c5d (patch) | |
| tree | 25998420abdb0142ccf05dd6aaaa652baff77f8a | |
| parent | Add support for some more binary ops: |, &, ^ (diff) | |
| download | cup-c096eb37487295610ff43825163d676b35799c5d.tar.xz cup-c096eb37487295610ff43825163d676b35799c5d.zip | |
Add `OS_IS_MACOS` and `OS_IS_LINUX` constants as builtins
| -rw-r--r-- | src/builtins.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/builtins.c b/src/builtins.c index 97ac9ee..541e628 100644 --- a/src/builtins.c +++ b/src/builtins.c @@ -40,6 +40,14 @@ void initialize_builtins() { push_posix_constants(); +#if __APPLE__ + push_constant("OS_IS_MACOS", 1); + push_constant("OS_IS_LINUX", 0); +#else + push_constant("OS_IS_MACOS", 0); + push_constant("OS_IS_LINUX", 1); +#endif + Node *node; // FIXME: The `TYPE_ANY` is a hack node = Node_new(AST_BUILTIN); |