-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
does it work with wchar_t? #39
Comments
Do you have a header / repo I could use to reproduce? |
@roozbehid-ic But yes, there is support for |
This is the header
and how I run it and what I get
|
Issue was the directory was not specified for input and output. I always used it like this before:
I fixed it where if the directory is not specified then the current directory would be used. Let me know if you have any other issues or things are still persisting. |
Thanks I got past that one but getting a new error.
You can see the header file here. |
Problem was: typedef int PNSC_FNSPEECH_DATA (const unsigned char *pData, unsigned int cbDataSize, PNSC_SOUND_DATA pSoundData, void *pAppInstanceData); This is the first time I have encountered a function proto inlined as a typedef in this fashion. Usually I encounter function protos in this fashion: typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win, const SDL_Point *area, void *data); Anyways just a small couple line fix in logic: d1c74f0 Note that the API in question looks to be quite intensive on strings. Please advise that casting |
Thank you so much for all the help. Would you mind telling how you discovered what went wrong. At least it helps future people to know how to diagnose the problems. |
Last time I looked into it it it was implementation details: each C string ( There is a whole GitHub issue on .NET about this problem: dotnet/corefxlab#2350 |
I just run the program with the debugger enabled and observe the stack trace. I then unravel the stack and observe the state of variables and other memory which cause the program to enter the particular state. The only magical pieces are The tests are mostly done via smoke tests which I use the bindings generated by |
Makes sense.
Which probably ends up being similar to what you do.
or
in This one |
I am wondering why are you caching strings? |
Consider the case where a C library uses C strings (
|
This is interesting, I'll have to try it out sometime and see if it makes more sense. Right now implicit casting makes |
Also FYI, I pasted the code to show custom marshallers could potentially be used (although I don't think they can be used in unmanaged function pointers) What do you think about a special mode of c2cs program that would generate managed C# code and also uses these marshaling? |
Sure, it could be an option that starts at the
|
I can give it a try and see if I can send a PR for you. Thanks |
Just a note of warning, I have StyleCop ruleset turned on for this project. You can disable it by adding the following to the <EnableAnalyzers>false</EnableAnalyzers> |
Closing as the original problem was resolved |
@roozbehid-ic I have just encountered a grave mistake on my part. |
I'm going to close this actually a create a new issue and link the related issues. |
I am getting an error with wchar_t.
I also included #include <stddef.h> to bypass clang error but I do get following
The text was updated successfully, but these errors were encountered: