Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix __VA_ARGS__ on windows unfold error and register_handler name error #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CBHXuTT
Copy link

@CBHXuTT CBHXuTT commented Jun 19, 2021

  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少了首字母

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant