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
Original bug ID: 558 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: -for CamlIDL use https://github.com/xavierleroy/camlidl/issues
(* File generated from mask.idl *)
type i32 = int32
let _2x30 = Int32.of_int -1073741824
let sIGN = Int32.of_int 0
let mASK = Int32.of_int -1
What would you recommend to work around this? Maybe it is worth introducing long
int32/int64 integer literals (like 0x7FFFFFFFL) to OCaml/CamlIDL, that have an
appropriate type?
Hope to hear from you soon,
Dmitry
The text was updated successfully, but these errors were encountered:
What would you recommend to work around this? Maybe it is worth
introducing long int32/int64 integer literals (like 0x7FFFFFFFL) to
OCaml/CamlIDL, that have an appropriate type?
I agree the current CamlIDL essentially doesn't support int32 or int64
constants, but it should. I'll look into adding decent support, both
syntactically ([int32] and [int64] annotations on const) and semantically
(compute integer expressions with the appropriate precision, as in C).
Original bug ID: 558
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: -for CamlIDL use https://github.com/xavierleroy/camlidl/issues
Bug description
Full_Name: Dmitry Bely
Version: 3.02, camlidl current CVS
OS: WinNT 4.0
Submission from: d034.p8.col.ru (212.248.4.34)
I need an equivalent for the following C definitions:
#define MASK 0x7FFFFFFF /* my platform is IA32 */
#define SIGN 0x80000000
Unfortunately it seems that CamlIDL does not allow that. What did I try:
const [int32] int SIGN = 0x80000000; /* column 6: syntax error */
const [int32] int MASK = 0x7FFFFFFF;
CamlIDL does not allow attributes for consts. OK, second attempt:
typedef [int32] int i32;
const i32 SIGN = 0x80000000;
const i32 MASK = 0x7FFFFFFF;
compiles silenly, but produces
(* File generated from mask.idl *)
type i32 = int32
let sIGN = Int32.of_int 0
let mASK = Int32.of_int -1
That's not what I need! 3rd attempt:
typedef [int32] int i32;
const i32 _2x30 = 0x40000000;
const i32 SIGN = _2x30 * 2 ;
const i32 MASK = _2x30 * 2 - 1;
gives exactly the same result
(* File generated from mask.idl *)
type i32 = int32
let _2x30 = Int32.of_int -1073741824
let sIGN = Int32.of_int 0
let mASK = Int32.of_int -1
What would you recommend to work around this? Maybe it is worth introducing long
int32/int64 integer literals (like 0x7FFFFFFFL) to OCaml/CamlIDL, that have an
appropriate type?
Hope to hear from you soon,
Dmitry
The text was updated successfully, but these errors were encountered: