Create va_list dynamically

后端 未结 7 746
一个人的身影
一个人的身影 2020-12-06 01:08

I have a function

void foo(int cnt, va_list ap);

I need to use it, but requirement is quite strict, number of va_list vary an

7条回答
  •  臣服心动
    2020-12-06 01:39

    It depends on compiler what is the va_list type, what are the va_start and va_end macros. You cannot do this in a standard way. You would have to use compiler-specific construction.

    Maybe you can alter the 'foo' function? If so, then make it inversely - convert va_list to QList and make 'foo' accept QList.

    // EDIT

    Then see what the va_list type is, what the va_start and va_end macros are in your specific compiler. Then build your va_list in such a way that these macros will work on it.

提交回复
热议问题