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

Function detect_lib

tests/BS_thread_pool_test.cpp:650–669  ·  view source on GitHub ↗

* @brief Detect the C++ standard library used to compile this program. * * @return A string describing the C++ standard library. */

Source from the content-addressed store, hash-verified

648 * @return A string describing the C++ standard library.
649 */
650std::string detect_lib()
651{
652#if defined(_LIBCPP_VERSION)
653 return make_string("LLVM libc++ v", _LIBCPP_VERSION / 10000, '.', (_LIBCPP_VERSION / 100) % 100, '.', _LIBCPP_VERSION % 100); // NOLINT(readability-magic-numbers)
654#elif defined(_GLIBCXX_RELEASE)
655 std::string out = make_string("GNU libstdc++ v", _GLIBCXX_RELEASE);
656 #ifdef __GLIBCXX__
657 out += make_string(" (", __GLIBCXX__, ')');
658 #endif
659 return out;
660#elif defined(_MSVC_STL_VERSION)
661 std::string out = make_string("Microsoft STL v", _MSVC_STL_VERSION);
662 #ifdef _MSVC_STL_UPDATE
663 out += make_string(" (", _MSVC_STL_UPDATE, ')');
664 #endif
665 return out;
666#else
667 return "Other";
668#endif
669}
670
671/**
672 * @brief Detect the operating system used to compile this program.

Callers 1

show_introFunction · 0.85

Calls 1

make_stringFunction · 0.85

Tested by

no test coverage detected