Browse Source

get_package_version_string()

David Rose 16 years ago
parent
commit
da9f3f8a33

+ 21 - 0
dtool/src/dtoolutil/pandaSystem.cxx

@@ -56,6 +56,27 @@ get_version_string() {
   return PANDA_VERSION_STR;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: PandaSystem::get_package_version_string
+//       Access: Published, Static
+//  Description: Returns the version of the Panda3D distributable
+//               package associated with this build.  This version
+//               string is set by the builder at compile time;
+//               presumably the person who sets this is also
+//               responsible for building the indicated distributable
+//               package version.
+//
+//               If this string is empty, there is no distributable
+//               package associated with this build, and you should
+//               probably use a different build of Panda3D to generate
+//               your distributable applications to ensure
+//               compatibility.
+////////////////////////////////////////////////////////////////////
+string PandaSystem::
+get_package_version_string() {
+  return PANDA_PACKAGE_VERSION_STR;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: PandaSystem::get_major_version
 //       Access: Published, Static

+ 1 - 0
dtool/src/dtoolutil/pandaSystem.h

@@ -33,6 +33,7 @@ protected:
 
 PUBLISHED:
   static string get_version_string();
+  static string get_package_version_string();
 
   static int get_major_version();
   static int get_minor_version();

+ 5 - 0
dtool/src/dtoolutil/pandaVersion.h.pp

@@ -60,6 +60,11 @@ $[cdefine PANDA_OFFICIAL_VERSION]
 /* This is a string indicating who has provided this distribution. */
 # define PANDA_DISTRIBUTOR "$[PANDA_DISTRIBUTOR]"
 
+/* The string indicating the version number of the associated Panda3D
+   distributable package, or empty string if there is no associated
+   package. */
+# define PANDA_PACKAGE_VERSION_STR "$[PANDA_PACKAGE_VERSION]"
+
 #end pandaVersion.h