From 0ce9dc98b1d5abf05abd31cb53cb2e1e5eab1665 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 24 May 2018 15:01:35 -0600 Subject: [PATCH] general: Move inclusion of checkPandaVersion.h to dtoolbase This includes it everywhere, meaning developers no longer must remember to include it in each metalib init file. --- dtool/src/dtoolbase/dtoolbase_cc.h | 7 +++++++ panda/metalibs/panda/panda.cxx | 6 ------ panda/metalibs/pandabullet/pandabullet.cxx | 6 ------ panda/metalibs/pandadx9/pandadx9.cxx | 6 ------ panda/metalibs/pandaegg/pandaegg.cxx | 6 ------ panda/metalibs/pandaegg/pandaeggnopg.cxx | 6 ------ panda/metalibs/pandaexpress/pandaexpress.cxx | 6 ------ panda/metalibs/pandafx/pandafx.cxx | 6 ------ panda/metalibs/pandagl/pandagl.cxx | 6 ------ panda/metalibs/pandagles/pandagles.cxx | 6 ------ panda/metalibs/pandagles2/pandagles2.cxx | 6 ------ panda/metalibs/pandaode/pandaode.cxx | 6 ------ panda/metalibs/pandaphysics/pandaphysics.cxx | 6 ------ panda/metalibs/pandaphysx/pandaphysx.cxx | 6 ------ panda/src/android/pview.cxx | 6 ------ panda/src/framework/config_framework.cxx | 6 ------ panda/src/testbed/pview.cxx | 6 ------ 17 files changed, 7 insertions(+), 96 deletions(-) diff --git a/dtool/src/dtoolbase/dtoolbase_cc.h b/dtool/src/dtoolbase/dtoolbase_cc.h index 491bd92c22..98bf992cf9 100644 --- a/dtool/src/dtoolbase/dtoolbase_cc.h +++ b/dtool/src/dtoolbase/dtoolbase_cc.h @@ -19,6 +19,13 @@ #ifdef __cplusplus +// By including checkPandaVersion.h, we guarantee that runtime attempts to +// load any DLL will fail if they inadvertently link with the wrong version of +// dtool, which, transitively, means all DLLs must be from the same +// (ABI-compatible) version of Panda. + +#include "checkPandaVersion.h" + #ifdef USE_TAU // Tau provides this destructive version of stdbool.h that we must mask. #define __PDT_STDBOOL_H_ diff --git a/panda/metalibs/panda/panda.cxx b/panda/metalibs/panda/panda.cxx index 8a193a8a28..9c9cb8bb60 100644 --- a/panda/metalibs/panda/panda.cxx +++ b/panda/metalibs/panda/panda.cxx @@ -14,12 +14,6 @@ #include "config_pstatclient.h" #endif -// By including checkPandaVersion.h, we guarantee that runtime attempts to -// load libpanda.so.dll will fail if they inadvertently link with the wrong -// version of libdtool.so.dll. - -#include "checkPandaVersion.h" - #if !defined(CPPPARSER) && !defined(BUILDING_LIBPANDA) #error Buildsystem error: BUILDING_LIBPANDA not defined #endif diff --git a/panda/metalibs/pandabullet/pandabullet.cxx b/panda/metalibs/pandabullet/pandabullet.cxx index 4eaa6fcd04..588d47266e 100644 --- a/panda/metalibs/pandabullet/pandabullet.cxx +++ b/panda/metalibs/pandabullet/pandabullet.cxx @@ -7,12 +7,6 @@ #include "pandabullet.h" #include "config_bullet.h" -// By including checkPandaVersion.h, we guarantee that runtime attempts to -// load libpandabullet.so.dll will fail if they inadvertently link with the -// wrong version of libdtool.so.dll. - -#include "checkPandaVersion.h" - /** * Initializes the library. This must be called at least once before any of * the functions or classes in this library can be used. Normally it will be diff --git a/panda/metalibs/pandadx9/pandadx9.cxx b/panda/metalibs/pandadx9/pandadx9.cxx index 8953365225..a54bb7dbf2 100644 --- a/panda/metalibs/pandadx9/pandadx9.cxx +++ b/panda/metalibs/pandadx9/pandadx9.cxx @@ -9,12 +9,6 @@ #include "config_dxgsg9.h" #include "wdxGraphicsPipe9.h" -// By including checkPandaVersion.h, we guarantee that runtime attempts to -// load libpandadx9.dll will fail if they inadvertently link with the wrong -// version of libdtool.dll. - -#include "checkPandaVersion.h" - /** * Initializes the library. This must be called at least once before any of * the functions or classes in this library can be used. Normally it will be diff --git a/panda/metalibs/pandaegg/pandaegg.cxx b/panda/metalibs/pandaegg/pandaegg.cxx index 7bb592e488..235dc62a5b 100644 --- a/panda/metalibs/pandaegg/pandaegg.cxx +++ b/panda/metalibs/pandaegg/pandaegg.cxx @@ -9,12 +9,6 @@ #include "config_egg.h" #include "config_egg2pg.h" -// By including checkPandaVersion.h, we guarantee that runtime attempts to -// load libpandaegg.so.dll will fail if they inadvertently link with the wrong -// version of libdtool.so.dll. - -#include "checkPandaVersion.h" - /** * Initializes the library. This must be called at least once before any of * the functions or classes in this library can be used. Normally it will be diff --git a/panda/metalibs/pandaegg/pandaeggnopg.cxx b/panda/metalibs/pandaegg/pandaeggnopg.cxx index 1b72143237..2a5c86fead 100644 --- a/panda/metalibs/pandaegg/pandaeggnopg.cxx +++ b/panda/metalibs/pandaegg/pandaeggnopg.cxx @@ -8,12 +8,6 @@ #include "config_egg.h" -// By including checkPandaVersion.h, we guarantee that runtime attempts to -// load libpandaegg.so.dll will fail if they inadvertently link with the wrong -// version of libdtool.so.dll. - -#include "checkPandaVersion.h" - /** * Initializes the library. This must be called at least once before any of * the functions or classes in this library can be used. Normally it will be diff --git a/panda/metalibs/pandaexpress/pandaexpress.cxx b/panda/metalibs/pandaexpress/pandaexpress.cxx index 6c6adc0e77..d50aead132 100644 --- a/panda/metalibs/pandaexpress/pandaexpress.cxx +++ b/panda/metalibs/pandaexpress/pandaexpress.cxx @@ -3,9 +3,3 @@ * @author drose * @date 2000-05-15 */ - -// By including checkPandaVersion.h, we guarantee that runtime attempts to -// load libpandaexpress.so.dll will fail if they inadvertently link with the -// wrong version of libdtool.so.dll. - -#include "checkPandaVersion.h" diff --git a/panda/metalibs/pandafx/pandafx.cxx b/panda/metalibs/pandafx/pandafx.cxx index 968ab2f285..64f4a3abd8 100644 --- a/panda/metalibs/pandafx/pandafx.cxx +++ b/panda/metalibs/pandafx/pandafx.cxx @@ -8,12 +8,6 @@ #include "config_distort.h" -// By including checkPandaVersion.h, we guarantee that runtime attempts to -// load libpandafx.so.dll will fail if they inadvertently link with the wrong -// version of libdtool.so.dll. - -#include "checkPandaVersion.h" - /** * Initializes the library. This must be called at least once before any of * the functions or classes in this library can be used. Normally it will be diff --git a/panda/metalibs/pandagl/pandagl.cxx b/panda/metalibs/pandagl/pandagl.cxx index 71b6e83025..0e33961c9f 100644 --- a/panda/metalibs/pandagl/pandagl.cxx +++ b/panda/metalibs/pandagl/pandagl.cxx @@ -30,12 +30,6 @@ #error One of HAVE_WGL, HAVE_COCOA, HAVE_CARBON or HAVE_GLX must be defined when compiling pandagl! #endif -// By including checkPandaVersion.h, we guarantee that runtime attempts to -// load libpandagl.so.dll will fail if they inadvertently link with the wrong -// version of libdtool.so.dll. - -#include "checkPandaVersion.h" - /** * Initializes the library. This must be called at least once before any of * the functions or classes in this library can be used. Normally it will be diff --git a/panda/metalibs/pandagles/pandagles.cxx b/panda/metalibs/pandagles/pandagles.cxx index 27053534c6..f2ed5f3e1a 100644 --- a/panda/metalibs/pandagles/pandagles.cxx +++ b/panda/metalibs/pandagles/pandagles.cxx @@ -17,12 +17,6 @@ #include "eglGraphicsPipe.h" #endif -// By including checkPandaVersion.h, we guarantee that runtime attempts to -// load libpandagles.so.dll will fail if they inadvertently link with the -// wrong version of libdtool.so.dll. - -#include "checkPandaVersion.h" - /** * Initializes the library. This must be called at least once before any of * the functions or classes in this library can be used. Normally it will be diff --git a/panda/metalibs/pandagles2/pandagles2.cxx b/panda/metalibs/pandagles2/pandagles2.cxx index 4810bd60af..b0b36c63ff 100644 --- a/panda/metalibs/pandagles2/pandagles2.cxx +++ b/panda/metalibs/pandagles2/pandagles2.cxx @@ -12,12 +12,6 @@ #include "config_egldisplay.h" #include "eglGraphicsPipe.h" -// By including checkPandaVersion.h, we guarantee that runtime attempts to -// load libpandagles2.so.dll will fail if they inadvertently link with the -// wrong version of libdtool.so.dll. - -#include "checkPandaVersion.h" - /** * Initializes the library. This must be called at least once before any of * the functions or classes in this library can be used. Normally it will be diff --git a/panda/metalibs/pandaode/pandaode.cxx b/panda/metalibs/pandaode/pandaode.cxx index 583b9c3a9d..2b19c71e3b 100644 --- a/panda/metalibs/pandaode/pandaode.cxx +++ b/panda/metalibs/pandaode/pandaode.cxx @@ -7,12 +7,6 @@ #include "pandaode.h" #include "config_ode.h" -// By including checkPandaVersion.h, we guarantee that runtime attempts to -// load libpandaode.so.dll will fail if they inadvertently link with the wrong -// version of libdtool.so.dll. - -#include "checkPandaVersion.h" - /** * Initializes the library. This must be called at least once before any of * the functions or classes in this library can be used. Normally it will be diff --git a/panda/metalibs/pandaphysics/pandaphysics.cxx b/panda/metalibs/pandaphysics/pandaphysics.cxx index 890d450d47..02997a1505 100644 --- a/panda/metalibs/pandaphysics/pandaphysics.cxx +++ b/panda/metalibs/pandaphysics/pandaphysics.cxx @@ -8,12 +8,6 @@ #include "config_physics.h" #include "config_particlesystem.h" -// By including checkPandaVersion.h, we guarantee that runtime attempts to -// load libpandaphysics.so.dll will fail if they inadvertently link with the -// wrong version of libdtool.so.dll. - -#include "checkPandaVersion.h" - /** * Initializes the library. This must be called at least once before any of * the functions or classes in this library can be used. Normally it will be diff --git a/panda/metalibs/pandaphysx/pandaphysx.cxx b/panda/metalibs/pandaphysx/pandaphysx.cxx index fd75ee86b5..3e505f1d7d 100644 --- a/panda/metalibs/pandaphysx/pandaphysx.cxx +++ b/panda/metalibs/pandaphysx/pandaphysx.cxx @@ -7,12 +7,6 @@ #include "pandaphysx.h" #include "config_physx.h" -// By including checkPandaVersion.h, we guarantee that runtime attempts to -// load libpandaphysx.so.dll will fail if they inadvertently link with the -// wrong version of libdtool.so.dll. - -#include "checkPandaVersion.h" - /** * Initializes the library. This must be called at least once before any of * the functions or classes in this library can be used. Normally it will be diff --git a/panda/src/android/pview.cxx b/panda/src/android/pview.cxx index 2b31bb7577..6683b6206b 100644 --- a/panda/src/android/pview.cxx +++ b/panda/src/android/pview.cxx @@ -21,12 +21,6 @@ #include "bamCache.h" #include "virtualFileSystem.h" -// By including checkPandaVersion.h, we guarantee that runtime attempts to run -// pview will fail if it inadvertently links with the wrong version of -// libdtool.so.dll. - -#include "checkPandaVersion.h" - int main(int argc, char **argv) { PandaFramework framework; framework.open_framework(argc, argv); diff --git a/panda/src/framework/config_framework.cxx b/panda/src/framework/config_framework.cxx index 8746d5bff0..4ddc4b553a 100644 --- a/panda/src/framework/config_framework.cxx +++ b/panda/src/framework/config_framework.cxx @@ -16,12 +16,6 @@ #include "dconfig.h" #include "windowFramework.h" -// By including checkPandaVersion.h, we guarantee that runtime attempts to -// load libframework.so.dll will fail if they inadvertently link with the -// wrong version of libdtool.so.dll. - -#include "checkPandaVersion.h" - #if !defined(CPPPARSER) && !defined(BUILDING_FRAMEWORK) #error Buildsystem error: BUILDING_FRAMEWORK not defined #endif diff --git a/panda/src/testbed/pview.cxx b/panda/src/testbed/pview.cxx index 6d68f099ab..b5bb629b0c 100644 --- a/panda/src/testbed/pview.cxx +++ b/panda/src/testbed/pview.cxx @@ -29,12 +29,6 @@ #include "asyncTask.h" #include "boundingSphere.h" -// By including checkPandaVersion.h, we guarantee that runtime attempts to run -// pview will fail if it inadvertently links with the wrong version of -// libdtool.so.dll. - -#include "checkPandaVersion.h" - PandaFramework framework; ConfigVariableBool pview_test_hack