Skip to content

Method doesn't decay #29

@seven1240

Description

@seven1240

pure function args can be decayed to C, e.g.

package freeswitch

//so:extern
func Infof(format string, args ...any);

...

freeswitch.Infof("%s", "hello")

But method (functions with a receiver) doesn't decay.

//so:extern
func (session *Session) Infof(format string, args ...any)

the above code will generate:

    freeswitch_Session_Infof(session, so_str("in app\n"), (so_Slice){(void*[0]){}, 0, 0});
    freeswitch_Session_Infof(session, so_str("%s"), (so_Slice){(void*[1]){&(so_String){so_str("in app\n")}}, 1, 1});

full code https://github.com/rts-cn/mod_solod/blob/main/internal/freeswitch/session.go#L9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions