mono / CppSharp

Tools and libraries to glue C/C++ APIs to high-level languages
MIT License
3.15k stars 518 forks source link

add: options for DllImport and LibraryImport #1862

Open kumja1 opened 3 months ago

kumja1 commented 3 months ago

Resolves issue #1687

kumja1 commented 3 months ago

@dotnet-policy-service agree

tritao commented 3 months ago

The build is failing:

CSharpTypePrinter.cs(612,65): error CS1001: Identifier expected [/home/runner/work/CppSharp/CppSharp/src/Generator/CppSharp.Generator.csproj]

kumja1 commented 3 months ago

@tritao How would i regenerate the bindings for the cpp parser

tritao commented 3 months ago

Check https://github.com/mono/CppSharp/blob/main/src/CppParser/ParserGen/ParserGen.cs

And might want to extract https://github.com/mono/CppSharp/releases/download/CppSharp/headers.zip into your bin folder to generate for all supported platforms.

kumja1 commented 3 months ago

@tritao strings are typically utf16 in native code correct? or are they different depending on the platform(like wchar_t is utf32 on linux)

tritao commented 3 months ago

Yes they can be different depending on the platform or program.

It can be set as an option: https://github.com/mono/CppSharp/blob/main/src/Generator/Options.cs#L189