Evan Haas d4d21dd46d translate-c: better handling of int -> enum casts
In std.meta.cast when casting to an enum type from an integer type, first
do a C-style cast from the source value to the tag type of the enum.
This ensures that we don't get an error due to the source value not being
representable by the enum.

In transCCast() use std.meta.cast instead of directly emitting the cast
operation since the enum's underlying type may not be known at translation
time due to an MSVC bug, see https://github.com/ziglang/zig/issues/8003

Fixes #6011
2021-04-15 22:46:22 -04:00
..
2021-02-28 14:03:19 +01:00
2021-04-04 17:04:46 -07:00
2021-04-04 17:04:46 -07:00
2021-04-04 19:27:47 -04:00
2021-02-25 22:20:30 +02:00
2021-03-18 14:05:01 -07:00
2021-02-28 14:03:19 +01:00
2021-04-15 00:59:40 -07:00
2021-02-27 21:10:00 -07:00
2020-12-31 15:45:24 -08:00
2020-12-31 15:45:24 -08:00
2021-01-07 23:48:58 -08:00
2020-12-31 15:45:24 -08:00
2020-12-31 15:45:24 -08:00
2021-03-28 14:32:34 +02:00
2021-03-18 14:05:01 -07:00
2020-12-31 15:45:24 -08:00
2021-02-24 21:29:23 -07:00
2020-12-31 15:45:24 -08:00
2020-12-31 15:45:24 -08:00
2020-12-31 15:45:24 -08:00
2021-04-12 17:18:56 -04:00
2020-12-31 15:45:24 -08:00
2021-03-11 10:09:51 +11:00
2020-12-31 15:45:24 -08:00
2020-12-31 15:45:24 -08:00
2020-12-31 15:45:24 -08:00
2021-02-16 23:20:46 +01:00
2020-12-31 15:45:24 -08:00
2021-02-24 21:29:23 -07:00
2021-03-01 20:04:28 -07:00
2021-03-20 22:01:09 -07:00
2021-02-28 14:03:19 +01:00
2020-12-31 15:45:24 -08:00
2020-12-31 15:45:24 -08:00