CppSharp icon indicating copy to clipboard operation
CppSharp copied to clipboard

Is there a way to only generate the PInvoke functions?

Open TheButlah opened this issue 3 years ago • 2 comments
trafficstars

I'm using cppsharp but only using the static functions in generated.__Internal - none of the wrappers cppsharp generates handle the ownership semantics I'm exposing in my C library. I'd like to get cppsharp to only provide the actual static extern functions and C structs.

Also, is there a way to have cppsharp stop changing the name of these functions? I have a particular use of __ and cppsharp removes them or changes them to only 1 underscore

TheButlah avatar Jul 20 '22 19:07 TheButlah

At the moment there is no builtin support to only generate the C P/invoke structs and signatures.

Where does CppSharp rename the functions in the generated code? Is it just at the C# wrapper level or does it also change the symbol name at P/Invoke/DllImport level?

tritao avatar Jul 20 '22 19:07 tritao

It also changes it at the PInvoke level. for example:

[SuppressUnmanagedCodeSecurity, DllImport("tp_client", EntryPoint = "tp_client__baseline__Baseline__state_mut_U64", CallingConvention = __CallingConvention.Cdecl)]
internal static extern __IntPtr TpClientBaselineBaselineStateMutU64(__IntPtr b, __IntPtr state);

TheButlah avatar Jul 20 '22 20:07 TheButlah