While trying to use the library with zigs c-interop feature, I ran into some compiler errors, mostly because of the using keyword in Client.h. This happens, because while zig can compile c++ source code just fine, it can not work with c++ header files.
Since I did not like the idea of writing a whole c only wrapper, I decided to try and patch the header file. Afterwards I ran into some additional issues with the DBGPRINT makro, because __FUNCTIONW__ is undefined when compiling with zig and tI could not find another way to get the functionname as a wide string directly.
The changes I made allow me to successfully run the following demo code:
As expected a xbox 360 controller shows up and disappears after exiting the program, but I did not do any further testing so far!
Please review my changes and feel free to point out all the ways I messed up, as I do not have much experience with c++ and this is my first PR. 😅
I'm willing to do some further work on this topic, if compatibility with zig is in your intrest aswell!
While trying to use the library with zigs c-interop feature, I ran into some compiler errors, mostly because of the
using
keyword inClient.h
. This happens, because while zig can compile c++ source code just fine, it can not work with c++ header files. Since I did not like the idea of writing a whole c only wrapper, I decided to try and patch the header file. Afterwards I ran into some additional issues with theDBGPRINT
makro, because__FUNCTIONW__
is undefined when compiling with zig and tI could not find another way to get the functionname as a wide string directly.The changes I made allow me to successfully run the following demo code:
As expected a xbox 360 controller shows up and disappears after exiting the program, but I did not do any further testing so far! Please review my changes and feel free to point out all the ways I messed up, as I do not have much experience with c++ and this is my first PR. 😅 I'm willing to do some further work on this topic, if compatibility with zig is in your intrest aswell!