Skip to content

How do I pass Varargs for object[] args but i worry about Linux and macOS because __arglist doesn't work everyone. #107007

Closed Answered by huoyaoyuan
DeafMan1983 asked this question in Q&A
Discussion options

You must be logged in to vote

If the native code is under your control, the only way is defining it like this:

struct ARG_SLOT
{
    int type;
    void* value;
};

ret_t function(int requiredParam, int va_count, ARG_SLOT* va_list);

And define your own rule to interpret ARG_SLOT with different types.

If it's not under your control like printf, then you have literally no way to use it correctly.

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
7 replies
@DeafMan1983
Comment options

@huoyaoyuan
Comment options

@huoyaoyuan
Comment options

@huoyaoyuan
Comment options

Answer selected by DeafMan1983
@msedi
Comment options

Comment options

You must be logged in to vote
1 reply
@huoyaoyuan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants