From 36df3bdf0b93ab0783a37c81958b92f1bdc6a70a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 3 Jul 2019 21:41:17 -0600 Subject: [PATCH] dcparser: Delete dcPython.h py_panda.h has the same purpose; we also don't want Python.h brought in from the headers (only from the .cxx files) so that including the headers won't require linkage against Python. --- direct/src/dcparser/dcClass.cxx | 3 ++ direct/src/dcparser/dcClass.h | 1 - direct/src/dcparser/dcField.cxx | 3 ++ direct/src/dcparser/dcField.h | 1 - direct/src/dcparser/dcPacker.h | 1 - direct/src/dcparser/dcPython.h | 42 ------------------- .../cDistributedSmoothNodeBase.cxx | 4 ++ .../distributed/cDistributedSmoothNodeBase.h | 1 - 8 files changed, 10 insertions(+), 46 deletions(-) delete mode 100644 direct/src/dcparser/dcPython.h diff --git a/direct/src/dcparser/dcClass.cxx b/direct/src/dcparser/dcClass.cxx index 9487c5e323..9f7942e997 100644 --- a/direct/src/dcparser/dcClass.cxx +++ b/direct/src/dcparser/dcClass.cxx @@ -18,6 +18,9 @@ #include "dcindent.h" #include "dcmsgtypes.h" +#include "datagram.h" +#include "datagramIterator.h" + #include "dcClassParameter.h" #include diff --git a/direct/src/dcparser/dcClass.h b/direct/src/dcparser/dcClass.h index 94feae1c19..481dc1bd60 100644 --- a/direct/src/dcparser/dcClass.h +++ b/direct/src/dcparser/dcClass.h @@ -17,7 +17,6 @@ #include "dcbase.h" #include "dcField.h" #include "dcDeclaration.h" -#include "dcPython.h" #ifdef WITHIN_PANDA #include "pStatCollector.h" diff --git a/direct/src/dcparser/dcField.cxx b/direct/src/dcparser/dcField.cxx index 5880fd5097..90bd018250 100644 --- a/direct/src/dcparser/dcField.cxx +++ b/direct/src/dcparser/dcField.cxx @@ -18,6 +18,9 @@ #include "hashGenerator.h" #include "dcmsgtypes.h" +#include "datagram.h" +#include "datagramIterator.h" + #ifdef HAVE_PYTHON #include "py_panda.h" #endif diff --git a/direct/src/dcparser/dcField.h b/direct/src/dcparser/dcField.h index 96b7da4487..ec7a8fd05f 100644 --- a/direct/src/dcparser/dcField.h +++ b/direct/src/dcparser/dcField.h @@ -17,7 +17,6 @@ #include "dcbase.h" #include "dcPackerInterface.h" #include "dcKeywordList.h" -#include "dcPython.h" #ifdef WITHIN_PANDA #include "pStatCollector.h" diff --git a/direct/src/dcparser/dcPacker.h b/direct/src/dcparser/dcPacker.h index dce28dbc30..6e73a2d9ea 100644 --- a/direct/src/dcparser/dcPacker.h +++ b/direct/src/dcparser/dcPacker.h @@ -19,7 +19,6 @@ #include "dcSubatomicType.h" #include "dcPackData.h" #include "dcPackerCatalog.h" -#include "dcPython.h" class DCClass; class DCSwitchParameter; diff --git a/direct/src/dcparser/dcPython.h b/direct/src/dcparser/dcPython.h deleted file mode 100644 index 513f1b008e..0000000000 --- a/direct/src/dcparser/dcPython.h +++ /dev/null @@ -1,42 +0,0 @@ -/** - * PANDA 3D SOFTWARE - * Copyright (c) Carnegie Mellon University. All rights reserved. - * - * All use of this software is subject to the terms of the revised BSD - * license. You should have received a copy of this license along - * with this source code in a file named "LICENSE." - * - * @file dcPython.h - * @author drose - * @date 2004-06-22 - */ - -#ifndef DCPYTHON_H -#define DCPYTHON_H - -// The only purpose of this file is to serve as a common place to put the -// nonsense associated with #including . - -#ifdef HAVE_PYTHON - -#define PY_SSIZE_T_CLEAN 1 - -#undef _POSIX_C_SOURCE -#undef _XOPEN_SOURCE -#include - -// Python 2.5 adds Py_ssize_t; earlier versions don't have it. -#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) -typedef int Py_ssize_t; -#define PY_SSIZE_T_MAX INT_MAX -#define PY_SSIZE_T_MIN INT_MIN -#endif - -// Several interfaces in this module that use Python also require these header -// files, so we might as well pick them up too. -#include "datagram.h" -#include "datagramIterator.h" - -#endif // HAVE_PYTHON - -#endif diff --git a/direct/src/distributed/cDistributedSmoothNodeBase.cxx b/direct/src/distributed/cDistributedSmoothNodeBase.cxx index 67e273644f..564ac6ac9b 100644 --- a/direct/src/distributed/cDistributedSmoothNodeBase.cxx +++ b/direct/src/distributed/cDistributedSmoothNodeBase.cxx @@ -18,6 +18,10 @@ #include "dcmsgtypes.h" #include "config_distributed.h" +#ifdef HAVE_PYTHON +#include "py_panda.h" +#endif + static const PN_stdfloat smooth_node_epsilon = 0.01; static const double network_time_precision = 100.0; // Matches ClockDelta.py diff --git a/direct/src/distributed/cDistributedSmoothNodeBase.h b/direct/src/distributed/cDistributedSmoothNodeBase.h index 6c57f6a2bf..43dfe5fc8a 100644 --- a/direct/src/distributed/cDistributedSmoothNodeBase.h +++ b/direct/src/distributed/cDistributedSmoothNodeBase.h @@ -18,7 +18,6 @@ #include "nodePath.h" #include "dcbase.h" #include "dcPacker.h" -#include "dcPython.h" // to pick up Python.h #include "clockObject.h" class DCClass;