Skip to content

Support hooking functions with varargs #4

Open
@caspark

Description

@caspark

I'm trying to hook! printf but the hook! macro doesn't allow it:

src/lib.rs:25:45: 25:48 error: expected ident, found ...
src/lib.rs:25     unsafe fn printf(format: *const c_char, ...) -> c_int => custom_printf {

However, the compiler is perfectly happy with:

extern {
    fn printf(format: *const c_char, ...) -> c_int;
 }

so perhaps it's just that hook!'s macro definition needs to be updated to support varargs? But I suppose that real! might need to be updated to support calling varargs functions too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions