diff --git a/dtool/src/dtoolutil/pandaSystem.cxx b/dtool/src/dtoolutil/pandaSystem.cxx index 0e6e0ed491..742f8973be 100644 --- a/dtool/src/dtoolutil/pandaSystem.cxx +++ b/dtool/src/dtoolutil/pandaSystem.cxx @@ -131,6 +131,41 @@ string PandaSystem:: get_distributor() { return PANDA_DISTRIBUTOR; } + +//////////////////////////////////////////////////////////////////// +// Function: PandaSystem::get_compiler +// Access: Published, Static +// Description: Returns a string representing the compiler that was +// used to generate this version of Panda, if it is +// available, or "unknown" if it is not. +//////////////////////////////////////////////////////////////////// +string PandaSystem:: +get_compiler() { +#ifdef COMPILER + // MSVC defines this macro. + return COMPILER; + +#elif defined(__GNUC__) + // GCC defines this one. + return "GCC " __VERSION__; + +#else + // For other compilers, you're on your own. + return "unknown"; +#endif +} + +//////////////////////////////////////////////////////////////////// +// Function: PandaSystem::get_build_date +// Access: Published, Static +// Description: Returns a string representing the date and time at +// which this version of Panda (or at least dtool) was +// compiled, if available. +//////////////////////////////////////////////////////////////////// +string PandaSystem:: +get_build_date() { + return __DATE__ " " __TIME__; +} //////////////////////////////////////////////////////////////////// // Function: PandaSystem::has_system diff --git a/dtool/src/dtoolutil/pandaSystem.h b/dtool/src/dtoolutil/pandaSystem.h index c5ef31c837..b6a97db42b 100644 --- a/dtool/src/dtoolutil/pandaSystem.h +++ b/dtool/src/dtoolutil/pandaSystem.h @@ -43,6 +43,8 @@ PUBLISHED: static bool is_official_version(); static string get_distributor(); + static string get_compiler(); + static string get_build_date(); bool has_system(const string &system) const; int get_num_systems() const;