How to override

Open
#1,848 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
c, csharp
Domain
devtools

Research direction

Start with the typedef enum and SP_SetProperty declaration in the issue, then inspect CppSharp's parameter type-mapping and override entry points. Document how a long parameter can be represented with SP_ATTR_ENUM, including the relevant configuration path and a way to verify the generated binding.

Written by the indexing model from the issue text.

Description

Brief Description

In my situation I have a typedefed C enum that is intended to be passed as a parameter to a function. However, this function declaration merely identifies the parameter as a long so there is no way for CppSharp to figure out that the 2 are related. How can I override the parameter of this function to use the Enum type?

OS: Windows

Used headers
// attribute 
typedef enum
{
    SP_ATTR_TIMEOUT         = 1,
    SP_ATTR_LOG             = 2        
} SP_ATTR_ENUM;

SP_EXPORT int       SP_API SP_SetProperty   (SP_HANDLE hDiag, long lProperty, long lFlag, const void *lpValue);
Dominant language
C#
Stars
3.4k
Forks
541
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mono/CppSharp

All issues in mono/CppSharp

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.