Hi All,

A quick heads up... We caught a bug report because Clang got into a
code path intended for MSVC.

The problem is like the Apple and LLVM CLang problem. The issue
surfaced recently for us on WIndows platforms. We expected Clang to
get into certain code paths for MSYS2 (and MinGW and Cygwin), but
Clang got into code paths for MSVC because Microsoft is using it or
offering it as an alternative.

Like with the Apple issue, detect it like so:

    #if defined(__clang__) && defined(__apple_build_version__)
    # define APPLE_CLANG_VERSION (__clang_major__ * 10000 +
__clang_minor__ * 100 + __clang_patchlevel__)
    #elif defined(__clang__) && defined(_MSC_VER)
    # define MSVC_CLANG_VERSION (__clang_major__ * 10000 +
__clang_minor__ * 100 + __clang_patchlevel__)
    #elif defined(__clang__)
    # define LLVM_CLANG_VERSION  (__clang_major__ * 10000 +
__clang_minor__ * 100 + __clang_patchlevel__)
    #endif

The defines should help you to keep different Clang varieties in
expected code paths.

Jeff

Reply via email to