Panda3D
 All Classes Functions Variables Enumerations
dcPython.h
1 // Filename: dcPython.h
2 // Created by: drose (22Jun04)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef DCPYTHON_H
16 #define DCPYTHON_H
17 
18 // The only purpose of this file is to serve as a common place to put
19 // the nonsense associated with #including <Python.h>.
20 
21 #ifdef HAVE_PYTHON
22 
23 #undef HAVE_LONG_LONG // NSPR and Python both define this.
24 #undef _POSIX_C_SOURCE
25 #include <Python.h>
26 
27 // Python 2.5 adds Py_ssize_t; earlier versions don't have it.
28 #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
29 typedef int Py_ssize_t;
30 #define PY_SSIZE_T_MAX INT_MAX
31 #define PY_SSIZE_T_MIN INT_MIN
32 #endif
33 
34 // Several interfaces in this module that use Python also require
35 // these header files, so we might as well pick them up too.
36 #include "datagram.h"
37 #include "datagramIterator.h"
38 
39 #endif // HAVE_PYTHON
40 
41 #endif