Skip to content

There is both `EIGEN_COMP_GNUC` and `EIGEN_COMP_GNUC_STRICT`, do similar for Clang?

I notice there is both EIGEN_COMP_GNUC and EIGEN_COMP_GNUC_STRICT, no doubt because Clang (and others?) define __GNUC__.

On the other hand, there is an EIGEN_COMP_CLANG but there is no EIGEN_COMP_CLANG_STRICT. Something similar is desirable because, as you know, there is both open source clang and various forks like Apple's version. And they use different version numbering. So existing checks like EIGEN_COMP_CLANG>=380 aren't correct.

I can make a patch, but wanted to discuss the preferred solution first.

I'm thinking maybe we should add:

#if defined(__clang__) && defined(__apple_build_version__)
  #define EIGEN_COMP_APPLE_CLANG __apple_build_version__
#else
  #define EIGEN_COMP_APPLE_CLANG 0
#endif