You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently writing a Max/MSP library (external) using JoyShockLibrary in C. Current header file is not so C friendly. Seperating headers for C and C++ or modifying current file could work. What you think?
The text was updated successfully, but these errors were encountered:
The last problem that isn't so quick and uncontroversial to correct is that the API uses references and default arguments.
These are both C++ features. I'm honestly not sure how it works at all with the current extern "C" in front of everything, I wouldn't think those would be usable features for functions marked like that.
It would be a breaking change to fix that, which would surely annoy existing users. Perhaps a reason supporting creating a separate header with a C api for the library, though it would be questionable code duplication.
So it leaves the question:
Is it worth breaking current programs to leave a C compatible API?
If yes, then changing all the references to pointers and removing default arguments is the easiest way to go.
If no, then I guess creating a header with a few functions wrapping the C++ feature usages would be the way to go.
The API is very close to being C compatible, but not quite...
I'm happy to submit a PR implementing whichever approach the maintainer(s) deem appropriate.
I'm currently writing a Max/MSP library (external) using JoyShockLibrary in C. Current header file is not so C friendly. Seperating headers for C and C++ or modifying current file could work. What you think?
The text was updated successfully, but these errors were encountered: