MSVC, GCC and Clang all support #pragma push_macro/pop_macro
, which means you can just push the check
macro before including Armadillo, and pop it afterwards:
#ifdef check
# pragma push_macro("check")
# undef check
# include <armadillo>
# pragma pop_macro("check")
#else
# include <armadillo>
#endif