Hi,
I am trying to use c2nim to make a wrapper for the Clap AudioPlugin API.
I have a line of c code that looks like this:
static CLAP_CONSTEXPR const char CLAP_EXT_LATENCY[] = "clap.latency";
c2nim converts that to:
var CLAP_EXT_LATENCY*: UncheckedArray[char] = "clap.latency"
when I try to compile that though, I get a type mismatch error:
Error: type mismatch: got 'string' for '"clap.latency"' but expected 'UncheckedArray[char]'
I have tried casting the string to UncheckedArray and using cstring, but the compiler always complains. I am looking for a solution for this problem, but also a way that I might be able to preprocess the file so that c2nim converts it to something compilable.
Thanks in advance for any tips!
Ok, thanks for taking a look.
I have a script that does some preprocessing on the .h files and some post processing on the .nim files after the c2nim conversion. I was looking at how nimraylib_now does it, and trying to do something similar.
I am dealing with this in the post-processing by replacing all occurrences of UncheckedArray[char] with cstring. This seems to do the trick. I thought there might be an alternative way to do this that I might be missing.