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-03-04 11:56:31 -08:00
2021-04-07 16:26:21 -07:00
2021-02-10 20:06:12 -07:00
2021-03-17 11:25:51 -07:00
2021-02-28 14:03:19 +01:00
2021-03-05 13:11:20 +01:00
2021-04-04 17:04:46 -07:00
2021-03-21 23:07:02 +02:00
2021-01-30 20:15:26 -07:00
2021-04-04 17:04:46 -07:00
2021-04-04 19:27:47 -04:00
2021-04-03 13:09:20 +02: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-03-29 09:22:06 +02:00
2021-04-12 11:37:00 -07:00
2021-02-27 21:10:00 -07:00
2020-12-31 15:45:24 -08:00
2021-02-28 14:03:19 +01: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
2021-04-11 17:40:19 -04:00
2021-03-28 11:02:37 +02:00
2021-01-08 16:54:56 -05:00
2021-02-27 01:21:01 -07: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-27 13:11:47 +02:00
2021-04-15 02:02:36 -07:00
2021-02-10 20:06:13 -07:00
2021-03-16 01:10:32 +01:00
2021-01-07 23:48:58 -08:00
2021-02-24 21:29:23 -07:00
2021-01-22 15:46:58 +01:00
2020-12-31 15:45:24 -08:00
2021-03-17 11:25:51 -07:00
2020-12-31 15:45:24 -08:00
2021-04-08 23:17:36 -07: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
2021-03-24 19:11:44 +01:00
2020-12-31 15:45:24 -08:00
2021-02-22 00:22:46 +02:00
2021-03-28 15:44:15 +02:00
2021-03-28 14:32:34 +02:00
2021-04-10 12:49:02 -07: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
2021-04-04 10:16:59 +02:00
2020-12-31 15:45:24 -08:00
2021-01-04 14:03:21 -08:00
2021-02-24 21:29:23 -07:00
2021-03-17 19:59:57 +01:00
2021-03-01 20:04:28 -07:00
2021-03-20 22:01:09 -07:00
2021-04-15 22:46:22 -04:00
2021-03-12 00:17:35 +01:00
2021-02-21 11:56:14 +02:00
2021-02-28 14:03:19 +01:00
2021-04-14 16:40:06 -07:00
2021-01-02 01:10:47 +11:00
2021-02-01 15:27:39 -05:00
2021-01-18 19:02:11 +00:00
2021-04-02 10:52:23 -07:00
2021-02-25 16:41:42 -07:00
2021-03-12 19:31:59 -05:00
2021-01-22 15:46:58 +01:00
2021-01-12 18:13:29 -08:00
2021-01-06 15:53:53 -08:00
2020-12-31 15:45:24 -08:00
2021-04-10 22:47:22 -05:00
2021-04-08 19:05:05 -07:00
2021-04-11 17:40:19 -04:00
2021-04-09 10:04:16 -07:00
2021-03-12 15:04:36 +01:00
2021-04-07 08:33:32 -04:00
2020-12-31 15:45:24 -08:00
2021-01-22 15:46:58 +01:00
2021-04-08 22:47:08 +02:00
2021-04-09 10:15:46 -07:00