External interfaces long long typedef returns a CPointer

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

External interfaces long long typedef returns a CPointer

Vincent Lesbros-2
Hi,

I have defined an external interface to a C .dll
from the following header :

--header.h--
typedef __int64 compteur;

compteur  fonction (void *ptr1, const float *ptr2, compteur nombre) ;

-external interface Interface defs :

compteur
        <C: typedef long long compteur>

fonction: ptr1 with: ptr2 with: items
        <C: compteur fonction(void *ptr1, const float * ptr2, compteur items)>
        ^self externalAccessFailedWith: _errorCode

When I call the function with this definition, the function fails and
the return value is erroneously instantiated with an (invalid)
CPointer (instead of the expected 64bit integer).
If I replace the typedef by the type long long as the return value,
Like this :

fonction: ptr1 with: ptr2 with: items
        <C: long long fonction(void *ptr1, const float * ptr2, compteur items)>
        ^self externalAccessFailedWith: _errorCode

The function works well, and the return value is correct.
I don't understand why the first version fails ???
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc