Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //wget http://pastebin.com/raw.php?i=LsvHAZqC main.cpp; g++ main.cpp -o test; ./test
- #include <string>
- using namspace std;
- string to_string()
- {
- return "";
- }
- template<typename T>
- string to_string(T x)
- {
- stringstream str;
- str << x;
- return str.str();
- }
- string CompilerName()
- {
- return "built " __DATE__ " " __TIME__
- "; built with: "
- #if defined(__clang__)
- "Clang/LLVM " __VERSION__
- #elif defined(__ICC) || defined(__INTEL_COMPILER)
- "Intel ICC/ICPC " + to_string(__INTEL_COMPILER_BUILD_DATE) +
- #elif defined(__GNUC__) || defined(__GNUG__)
- "GNU GCC/G++ " __VERSION__
- #elif defined(__HP_cc) || defined(__HP_aCC)
- "Hewlett-Packard C/C++ " + to_string(__HP_aCC) + to_string(__HP_cc) +
- #elif defined(__IBMC__) || defined(__IBMCPP__)
- "IBM XL C/C++ " __xlc__
- #elif defined(_MSC_VER)
- "Microsoft Visual Studio " + to_string(_MSC_FULL_VER) +
- #elif defined(__PGI)
- "Portland Group PGCC/PGCPP"
- #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
- "Oracle Solaris Studio"
- #else
- " unknown compiler"
- #endif
- ;
- }
- int main(int, char**)
- {
- cout << CompilerName() << "\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement