MCPcopy Create free account
hub / github.com/bshoshany/thread-pool / detect_compiler

Function detect_compiler

tests/BS_thread_pool_test.cpp:611–625  ·  view source on GitHub ↗

* @brief Detect the compiler used to compile this program. * * @return A string describing the compiler. */

Source from the content-addressed store, hash-verified

609 * @return A string describing the compiler.
610 */
611std::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.

Callers 1

show_introFunction · 0.85

Calls 1

make_stringFunction · 0.85

Tested by

no test coverage detected