Skip to main content
gamedev.net
🔒 Locked

Universal Function Pointer

Started by Zomart Dec 7, 2002 at 1:07 AM 1 replies 750+ views
Original Post
Zomart
Zomart
Hey- I''m trying to create a plugin system that has no requirements on the return types or parameters. I was wondering if there was any way to have one definition of a function pointer that will be able to point to any function or if there is any other way to create the desired effect. I''ve tried using linked lists of void pointer data, but programming that becomes a mess, so if anybody knows a better way I''d love to hear it. Thanks..
niyaw
niyaw
typedef int (*PointerToAnything)(...);

that will be ok with anything that returns a 32-bit value, including pointers, but if you want to return structs by value you're (i think) out of luck.

[edited by - niyaw on December 7, 2002 2:23:02 AM]
Zomart
Zomart
Cool, thanks man.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.