Skip to content

Macros did not apply correctly. #357

@kant2002

Description

@kant2002

original C++ file

typedef struct
{
	unsigned char *buf;
	int size;
} context_t;

#define PCONT ((context_t *)pcontext)

int buf_close(void *pcontext)
{
	PCONT->buf=0;
	return 0;
}

produced C#

namespace test
{
    public unsafe partial struct context_t
    {
        [NativeTypeName("unsigned char *")]
        public byte* buf;

        public int size;
    }

    public static unsafe partial class Methods
    {
        public static int buf_close(void* pcontext)
        {
            (context_t*)(pcontext)->buf = null; /// Issue is here !!!
            return 0;
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions