New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
camlidl and int64 attribute #2810
Comments
Comment author: administrator
Sorry for playing the spec lawyer once more, but the intent of the modifiers On an Alpha for instance (where sizeof(long) == 8), it makes perfect Still, you're pointing at an embarrassing shortcoming of Camlidl: Thanks for all your feedback; you're the first to really stress test
|
Comment author: administrator Xavier Leroy Xavier.Leroy@inria.fr writes:
but if you define typedef [int64] int TY; and compile it on MSBLSB 32-bit machine (or [int32] int on 64-bit MSBLSB typedef int TY; copy_int64() is defined as value copy_int64 (int64); /* defined in [ints.c] */ and expects 64-bit integer, not 32-bit. IMHO, we should at least generate a
Why simply do no translate typedef [int64] TY; to typedef int64 TY; // int64 defined in ocaml's config.h (similarly for unsigned)?
That would be nice, although right now I can live without it -- MIDL 1.0 ... cpp_quote("#ifndef ULONGLONG") #if (defined(__midl))
I have also made some changes to make camlidl COM part work under Hope to hear from you soon, |
Comment author: administrator Added support for __int64 and "hyper int" and "long long int". XL, 2001-06-29 |
Comment author: administrator
I don't follow you here. TY and int64 are both integral types, and Still, I just added the "__int64", "hyper int" and "long long" types
Right. Sorry for not having responded earlier. I played with mingw a
|
Original bug ID: 406
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.01, camlidl cvs 27.06.01
OS: Windows NT
Submission from: d009.p3.col.ru (195.210.132.9)
int64 attribute is handled wrong (and also int32 on 64-bit platforms). Example:
[test.idl]
typedef [int64] unsigned int DWORDLONG;
[end of test.idl]
is compiled to
[test.h]
...
typedef unsigned int DWORDLONG; // Error!
[end of test.h]
and
[test.c]
...
void camlidl_ml2c_test_DWORDLONG(value _v1, DWORDLONG * _c2, camlidl_ctx _ctx)
{
(*_c2) = Int64_val(_v1);
}
value camlidl_c2ml_test_DWORDLONG(DWORDLONG * _c2, camlidl_ctx _ctx)
{
value _v1;
_v1 = copy_int64((*_c2));
return _v1;
}
[end of test.c]
which obviously is not acceptable. We should generate
typedef uint64 DWORDLONG; // uint64 is ocaml's typedef
BTW, MIDL uses
typedef unsigned __int64 DWORDLONG;
I know, that's platform specific, but treating MSVC's __int64 and gcc's (long
long) as ([int64] int) would be nice. Of course I do not insist on that...
The text was updated successfully, but these errors were encountered: