Menu

#2 void parameter -> not wrapped

open
nobody
None
5
2005-08-16
2005-08-16
Marco Senn
No

We found today a mysterious thing with EWG. We wrapped
SDL_mixer.h into Eiffel, which has the following function:

extern DECLSPEC void SDLCALL Mix_HookMusicFinished(void
(*music_finished)(void));

As you can see, there is a (void) parameter given to
this function. This is equal to:

extern DECLSPEC void SDLCALL Mix_HookMusicFinished(void
(*music_finished)());

Well, under Windows, the first function above was
wrapped correctly (latest CVS version) as
void_void_anonymous_callback_callback.e (+ dispatcher)

Under Linux, the first function did not generate any
callback for this function. As we modified the header
to the second one (which is equal), the function was
wrapped as under Windows.

So we request you to have a look at this void-parameter
thing so it is wrapped equal on every system.

Thanks in advance

Discussion

  • Andreas Leitner

    Andreas Leitner - 2006-08-21

    Logged In: YES
    user_id=2991

    Please note that most C compilers assume that "void foo ()"
    is a variadic function, so indeed the above arguments are
    not equal. Also it could be that on Unix there is a typedef
    that gives the function pointer a name. In this case the
    wrapper will get a different name on Unix. The solution in
    this case is to also introduce the alias on Windows.

     
  • Marco Senn

    Marco Senn - 2006-09-29

    Logged In: YES
    user_id=563165

    Maybe you're right. I don't know your parsing algorithm, but
    treat it like a feature request that this case can be
    handled correctly. Is it possible an easy way? Otherwise
    I'll close the bug report

     

Log in to post a comment.

MongoDB Logo MongoDB