diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-03-14 13:47:40 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-03-14 13:47:40 -0400 |
| commit | 80ffb8044ab60cedfe2ce1c3025419c282cb0965 (patch) | |
| tree | 4487f38e4baa3cc4b92c0a57a4d8a41de20593d3 /builtins/macros.h | |
| parent | ecf425fb9aa12a0f3dd08d23bcd74919fb11b362 (diff) | |
Better codegen for negation
Diffstat (limited to 'builtins/macros.h')
| -rw-r--r-- | builtins/macros.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/builtins/macros.h b/builtins/macros.h index c6f474ec..6f9af8c9 100644 --- a/builtins/macros.h +++ b/builtins/macros.h @@ -16,9 +16,6 @@ $obj.$tag == $tag$##type_name##$##tag_name ? &$obj.tag_name : NULL; }) -#define not(x) _Generic(x, bool: (bool)!(x), int64_t: ~(x), int32_t: ~(x), int16_t: ~(x), int8_t: ~(x), \ - array_t: ((x).length == 0), table_t: ((x).entries.length == 0), CORD: ((x) == CORD_EMPTY), \ - default: _Static_assert(0, "Not supported")) #define Bool(x) _Generic(x, bool: (bool)(x), int64_t: (x != 0), int32_t: (x != 0), int16_t: (x != 0), int8_t: (x != 0), CORD: ((x) == CORD_EMPTY), \ array_t: ((x).length > 0), table_t: ((x).entries.length > 0), CORD: ((x) != CORD_EMPTY), \ default: _Static_assert(0, "Not supported")) |
