add get_compiler(), get_build_date()

This commit is contained in:
David Rose 2005-07-11 23:10:56 +00:00
parent 1e0716a20b
commit f0e16bfb8f
2 changed files with 37 additions and 0 deletions

View File

@ -132,6 +132,41 @@ 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
// Access: Published

View File

@ -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;