You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Note, LOG_KERN is not yet defined in libc, but I'm working on a PR for it). The type alias for LOG_KERN is c_int, which resolves to i32 on Mac OS X.
Whilst I can use a repr of i32, I'd rather not. Whilst in this particular case it's very highly unlikely that the definition of c_int will every change or vary across platforms (16-bit rust, anyone), one loses expressiveness and introduces a little more need to understand what's going on - limiting the usefulness of a type alias...
I've raised this as an issue, not a RFC or anything like that (a) because I'm new to all of this and (b) because what I just did was what I thought would be logical - it's the very first time I tried to use repr, and it didn't work as seemed obvious. Obviously if there's a better forum I'll move this.
The text was updated successfully, but these errors were encountered:
I'd like to use a type alias, in this case
c_int
, as therepr
of an enum. For example, in this code snippet:-(Note,
LOG_KERN
is not yet defined inlibc
, but I'm working on a PR for it). The type alias forLOG_KERN
isc_int
, which resolves toi32
on Mac OS X.Whilst I can use a
repr
ofi32
, I'd rather not. Whilst in this particular case it's very highly unlikely that the definition ofc_int
will every change or vary across platforms (16-bit rust, anyone), one loses expressiveness and introduces a little more need to understand what's going on - limiting the usefulness of a type alias...I've raised this as an issue, not a RFC or anything like that (a) because I'm new to all of this and (b) because what I just did was what I thought would be logical - it's the very first time I tried to use repr, and it didn't work as seemed obvious. Obviously if there's a better forum I'll move this.
The text was updated successfully, but these errors were encountered: