Skip to content

Macros in py_def signatures should not be expanded #3

@axw

Description

@axw

The py_def macro uses cmonster's Python-macro feature. This feature generates a _Pragma operator token, stringizing the arguments of the py_def macro. When this is done, any macros that happen to be in the arguments will be expanded. This may not be desirable...

For example:

#define XYZ 456
py_def(ABC(XYZ))
    return 123
py_end

cmonster will barf because XYZ in the signature will be replaced with 456. So we'll get (after extracting the signature/body):

def ABC(456):
    return 123

This is clearly not valid Python syntax for a function signature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions