Skip to content

Header named "interface.h" with func, defined outside class/struct, generates "public unsafe partial class interface" #1212

@AleXr64

Description

@AleXr64

Subj.
OS: Windows

Used headers

void Func();
in file named "interface.h"

incompilable generated code
    public unsafe partial class interface
    {
        public partial struct __Internal
        {
            [SuppressUnmanagedCodeSecurity]
            [DllImport("__Internal", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
                EntryPoint="?Func@@YAXXZ")]
            internal static extern void Func();
        }

        public static void Func()
        {
            __Internal.Func();
        }
    }

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