Note that _enum in Racket and enum in C use different backings. (#2308)

* Note that _enum in Racket and enum in C use different backings.

(It is worth noting that C does not specify the backing for enum, but
does say its range is that of an int.)
This commit is contained in:
Leif Andersen 2018-10-30 15:39:10 -04:00 committed by GitHub
parent c0fac954e1
commit e5ea77f802
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1736,7 +1736,19 @@ is to throw an exception.
(_enum '(ok = 0
invalid_input
buffer_too_small)))
]}
]
Note that the default basetype is @racket[_ufixint]. This
differs from C enumerations that can use any value in
@racket[_fixint]. Any @racket[_enum] using negative values
should use @racket[_fixint] for the base type.
@examples[#:eval ffi-eval
(define @#,racketidfont{_negative_enum}
(_enum '(unkown = -1
error = 0
ok = 1)
_fixint))]}
@defproc[(_bitmask [symbols (or symbol? list?)] [basetype ctype? _uint])
ctype?]{