xlab / c-for-go

Automatic C-Go Bindings Generator for Go Programming Language
https://c.for-go.com
MIT License
1.5k stars 119 forks source link

define pointer to function #135

Open mopo3ilo opened 2 years ago

mopo3ilo commented 2 years ago

c-for-go@v0.0.0-20221031195837-eaf8c81cbbe7

tcl.h 8.6.12

/*
 * Special freeProc values that may be passed to Tcl_SetResult (see the man
 * page for details):
 */

#define TCL_VOLATILE        ((Tcl_FreeProc *) 1)
#define TCL_STATIC      ((Tcl_FreeProc *) 0)
#define TCL_DYNAMIC     ((Tcl_FreeProc *) 3)

result

// Volatile as defined in include/tcl.h:1085
Volatile = ( ( FreeProc * )( 1 ))
// Static as defined in include/tcl.h:1086
Static = ( ( FreeProc * )( 0 ))
// Dynamic as defined in include/tcl.h:1087
Dynamic = ( ( FreeProc * )( 3 ))
lotodore commented 2 years ago

After taking a deep breath, and making a mental note never to use TCL (because one simply does not do things like this):

What would be the expected behaviour?