From d3e9e4c4f5f9e1c6492c6706bed98cc5566f9bdd Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 16 Jun 2010 01:18:20 +0000 Subject: [PATCH] coreapi version, increment plugin version --- dtool/PandaVersion.pp | 13 ++++++++++++- dtool/src/dtoolutil/pandaSystem.cxx | 25 +++++++++++++++++++++++++ dtool/src/dtoolutil/pandaSystem.h | 1 + dtool/src/dtoolutil/pandaVersion.h.pp | 1 + 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/dtool/PandaVersion.pp b/dtool/PandaVersion.pp index 02a65a344d..355761ece5 100644 --- a/dtool/PandaVersion.pp +++ b/dtool/PandaVersion.pp @@ -34,4 +34,15 @@ // PANDA_PACKAGE_VERSION, because it is anticipated that this plugin // code, once settled, will need to be updated much less frequently // than Panda itself. -#define P3D_PLUGIN_VERSION 1 0 1 +#define P3D_PLUGIN_VERSION 1 0 2 + +// Finally, there's a separate version number for the Core API. At +// first, we didn't believe we needed a Core API version number, but +// in this belief we were naive. This version number is a little less +// strict in its format requirements than P3D_PLUGIN_VERSION, above, +// and it doesn't necessarily consist of a specific number of +// integers, but by convention it will consist of four integers, and +// with the first three matching the plugin version, and the fourth +// integer being incremented with each new Core API revision. +#define P3D_COREAPI_VERSION $[P3D_PLUGIN_VERSION] 1 + diff --git a/dtool/src/dtoolutil/pandaSystem.cxx b/dtool/src/dtoolutil/pandaSystem.cxx index fcc08f2a01..79c9939e98 100644 --- a/dtool/src/dtoolutil/pandaSystem.cxx +++ b/dtool/src/dtoolutil/pandaSystem.cxx @@ -118,6 +118,31 @@ get_package_host_url() { #endif } +//////////////////////////////////////////////////////////////////// +// Function: PandaSystem::get_p3d_coreapi_version_string +// Access: Published, Static +// Description: Returns the current version of Panda's Core API, +// expressed as a string of dot-delimited integers. +// There are usually four integers in this version, but +// this is not guaranteed. +// +// The Core API is used during the runtime (plugin) +// environment only. This may be the empty string if +// the current version of Panda is not built to provide +// a particular Core API, which will be the normal case +// in a development SDK. However, you should not use +// this method to determine whether you are running in a +// runtime environment or not. +//////////////////////////////////////////////////////////////////// +string PandaSystem:: +get_p3d_coreapi_version_string() { +#ifndef P3D_COREAPI_VERSION_STR + return ""; +#else + return P3D_COREAPI_VERSION_STR; +#endif +} + //////////////////////////////////////////////////////////////////// // Function: PandaSystem::get_major_version // Access: Published, Static diff --git a/dtool/src/dtoolutil/pandaSystem.h b/dtool/src/dtoolutil/pandaSystem.h index e39869b99c..236303bceb 100644 --- a/dtool/src/dtoolutil/pandaSystem.h +++ b/dtool/src/dtoolutil/pandaSystem.h @@ -35,6 +35,7 @@ PUBLISHED: static string get_version_string(); static string get_package_version_string(); static string get_package_host_url(); + static string get_p3d_coreapi_version_string(); static int get_major_version(); static int get_minor_version(); diff --git a/dtool/src/dtoolutil/pandaVersion.h.pp b/dtool/src/dtoolutil/pandaVersion.h.pp index 543f9891c6..679d1153d6 100644 --- a/dtool/src/dtoolutil/pandaVersion.h.pp +++ b/dtool/src/dtoolutil/pandaVersion.h.pp @@ -81,6 +81,7 @@ $[cdefine PANDA_NUMERIC_VERSION] $[cdefine P3D_PLUGIN_MAJOR_VERSION] $[cdefine P3D_PLUGIN_MINOR_VERSION] $[cdefine P3D_PLUGIN_SEQUENCE_VERSION] +# define P3D_COREAPI_VERSION_STR "$[join .,$[P3D_COREAPI_VERSION]]" #endif #end pandaVersion.h