plugincpp icon indicating copy to clipboard operation
plugincpp copied to clipboard

fix __VA_ARGS__ on windows unfold error and register_handler name error

Open CBHXuTT opened this issue 4 years ago • 0 comments

  1. __VA_ARGS__ 在windows上visual studio上不能正确展开,只能被识别为一个参数。 1)可以在cmake中添加set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:preprocessor"),但是会带来一些警告。 2)通过宏#define EXPAND( ... ) __VA_ARGS__再转一层可以解决。
template<typename Self, typename Function>
int register_handler(Self&& self, std::string const& name, const Function& f) {
  register_handler(name, f, &self);
  return 0;
}

register_handler(name, f, &self);会导致name少了首字母

CBHXuTT avatar Jun 19 '21 02:06 CBHXuTT