* @brief Detect the compiler used to compile this program. * * @return A string describing the compiler. */
| 609 | * @return A string describing the compiler. |
| 610 | */ |
| 611 | std::string detect_compiler() |
| 612 | { |
| 613 | #if defined(__apple_build_version__) |
| 614 | return make_string("Apple Clang v", __clang_major__, '.', __clang_minor__, '.', __clang_patchlevel__); |
| 615 | #elif defined(__clang__) |
| 616 | return make_string("Clang v", __clang_major__, '.', __clang_minor__, '.', __clang_patchlevel__); |
| 617 | #elif defined(__GNUC__) |
| 618 | return make_string("GCC v", __GNUC__, '.', __GNUC_MINOR__, '.', __GNUC_PATCHLEVEL__); |
| 619 | #elif defined(_MSC_FULL_VER) |
| 620 | std::string msvc_full_ver = make_string(_MSC_FULL_VER); |
| 621 | return make_string("MSVC v", msvc_full_ver.substr(0, 2), '.', msvc_full_ver.substr(2, 2), '.', msvc_full_ver.substr(4)); |
| 622 | #else |
| 623 | return "Other"; |
| 624 | #endif |
| 625 | } |
| 626 | |
| 627 | /** |
| 628 | * @brief Detect the C++ standard used to compile this program. |
no test coverage detected