Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
intdemo_add(DemoHandle handle, int a, int b){ if (!handle) { return0; } auto* wrapper = static_cast<DemoWrapper*>(handle); int result = wrapper->impl.add(a, b); if (wrapper->callback) { std::string message = "add called"; wrapper->callback(message.c_str(), wrapper->user_data); } return result; }
char* demo_get_name(DemoHandle handle){ if (!handle) { returnnullptr; } returncopy_string("Calculator"); }
voiddemo_free_string(char* str){ if (str) { std::free(str); } }