Using typedef is the first thing that I tried. However it seems fd2pragma does not support that as it gave me an error. Reading the documentation I found the following;
"fd2pragma knows all standard parameter types defined in exec/types.h and dos/dos.h, all structures and some more types. All other #typedef's bring a warning. Do not use them in prototypes files!"
This is why I then took the other approach.
Quote:
Originally Posted by phx
This is certainly a bug in fd2pragma, but not trivial to fix.
Usually such function pointer types are avoided in dynamic libraries. Or simply replaced by APTR .
I would suggest to define the function pointer return value type with a typedef in your clib header:
Code:
typedef int (*MYFUNCTYPE)(int,int);
Then you can declare the function's prototype as
Code:
MYFUNCTYPE getFunction(void);
and fd2pragma might have less problems to generate correct code (it is more readable too).
|