-
-
Notifications
You must be signed in to change notification settings - Fork 24
add missing floating point literals #246
base: main
Are you sure you want to change the base?
Conversation
src/MacroTranslator.zig
Outdated
| // Zig doesn't support BFloat16, so the best thing we can do is convert it to u16, | ||
| // so that the value is bit-to-bit identic between the emitted Zig and original C code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless you have a specific use case I'd like to avoid adding workarounds for types that aren't supported by Zig yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My use case is that I import a header file that contains such constant. How should translate-c handle that ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Letting it go to that else branch would turn those macros into @compileErrors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I also upgraded the PR description.
0535ea9 to
64a596c
Compare
f41e45a to
92fd6d8
Compare
| .None, .F32x, .F64 => "f64", | ||
| .L => "c_longdouble", | ||
| .W => "f80", | ||
| .W, .F64x => "f80", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F64x should be long double.
Add the floating points literals that weren't handled: