This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Modifying data returned by __builtin_apply_args()
- From: "Frank Penczek" <frank dot penczek at googlemail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 13 Feb 2007 00:03:19 +0000
- Subject: Modifying data returned by __builtin_apply_args()
Dear Listmembers,
I'd like to omit the first parameter in the data object which
__builtin_apply_args() returns.
Example:
-----------------
/* function to be called */
void fun( int p0, int p1, int p2) {
/* do something */
}
/* function call wrapper */
void call( void (*fun)(), int p0, ...) {
int size;
void **args;
size = CalculateSize(); /* leaving aside details*/
args = __builtin_apply_args();
/* --> modify args here */
__builtin_apply( fun, args, size);
}
/* using the above */
...
call( &fun, 42, 0, 8);
...
-----------------
How do I strip the function pointer passed as first parameter
to 'call()' from 'args'?
If you bothered reading up to this point, thanks a lot
for your time.
Cheers,
Frank