I don't know if this is goes against the philosophy of the library or not, but I created a fork where you can call any function. With an extra syntax for C++.
auto f1 = (double(*)(double))cr_plugin_get_function(plugin, 0);
auto r1 = f(1.0f);
auto f2 = (double(*)(double,double))cr_plugin_get_function(plugin, 1);
auto r2 = f(1.0f, 2.0f);
The C++ version:
auto r1 = cr_plugin_call<double>(plugin, 0, 1.0f);
auto r2 = cr_plugin_call<double>(plugin, 1, 1.0f, 2.0f);
I don't know if this is goes against the philosophy of the library or not, but I created a fork where you can call any function. With an extra syntax for C++.
My first try is here: https://github.com/xunilrj/cr/commit/c1638e89c1550350575e3daae35400242247e240
I created some flags that makes this feature totally opt-in.
The C version:
The C++ version: