From 2e8b15cca44be11a9c5bf2eb10511e0ef33f3100 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 11 Jul 2005 23:25:34 +0000 Subject: [PATCH] compiler version on windows --- dtool/src/dtoolutil/pandaSystem.cxx | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/dtool/src/dtoolutil/pandaSystem.cxx b/dtool/src/dtoolutil/pandaSystem.cxx index 742f8973be..0552daf4c4 100644 --- a/dtool/src/dtoolutil/pandaSystem.cxx +++ b/dtool/src/dtoolutil/pandaSystem.cxx @@ -141,12 +141,29 @@ get_distributor() { //////////////////////////////////////////////////////////////////// string PandaSystem:: get_compiler() { -#ifdef COMPILER - // MSVC defines this macro. - return COMPILER; +#if defined(_MSC_VER) + // MSVC defines this macro. It's an integer; we need to format it. + ostringstream strm; + strm << "MSC v." << _MSC_VER; + + // We also get this suite of macros that tells us what the build + // platform is. +#if defined(_M_IX86) + #ifdef MS_WIN64 + strm << " 64 bit (Intel)"; + #else // MS_WIN64 + strm << " 32 bit (Intel)"; + #endif // MS_WIN64 +#elif defined(_M_IA64) + strm << " 64 bit (Itanium)"; +#elif defined(_M_AMD64) + strm << " 64 bit (AMD64)"; +#endif + + return strm.str(); #elif defined(__GNUC__) - // GCC defines this one. + // GCC defines this simple macro. return "GCC " __VERSION__; #else