diff options
author | Mukund Sivaraman <muks@isc.org> | 2014-01-10 06:08:41 +0100 |
---|---|---|
committer | Mukund Sivaraman <muks@isc.org> | 2014-01-10 06:21:12 +0100 |
commit | e3913c4a5ce52f94fcde221e5c9412970eb5f251 (patch) | |
tree | 1789eed90392232c9f7289e1cc0fecf3b6545690 /src | |
parent | Merge branch 'trac3243_2' (diff) | |
download | kea-e3913c4a5ce52f94fcde221e5c9412970eb5f251.tar.xz kea-e3913c4a5ce52f94fcde221e5c9412970eb5f251.zip |
[2026] Detect Py_hash_t in ./configure and define it internally if not
Diffstat (limited to '')
-rw-r--r-- | src/lib/dns/python/.gitignore | 1 | ||||
-rw-r--r-- | src/lib/dns/python/Makefile.am | 3 | ||||
-rw-r--r-- | src/lib/dns/python/pydnspp_common.h | 7 | ||||
-rw-r--r-- | src/lib/dns/python/pydnspp_config.h.in | 25 |
4 files changed, 30 insertions, 6 deletions
diff --git a/src/lib/dns/python/.gitignore b/src/lib/dns/python/.gitignore index 025ddd1d82..0713cf8c8f 100644 --- a/src/lib/dns/python/.gitignore +++ b/src/lib/dns/python/.gitignore @@ -1,2 +1,3 @@ /rrclass_constants_inc.cc /rrtype_constants_inc.cc +/pydnspp_config.h diff --git a/src/lib/dns/python/Makefile.am b/src/lib/dns/python/Makefile.am index a221bfee51..96542397a6 100644 --- a/src/lib/dns/python/Makefile.am +++ b/src/lib/dns/python/Makefile.am @@ -5,7 +5,8 @@ AM_CPPFLAGS += $(BOOST_INCLUDES) AM_CXXFLAGS = $(B10_CXXFLAGS) lib_LTLIBRARIES = libb10-pydnspp.la -libb10_pydnspp_la_SOURCES = pydnspp_common.cc pydnspp_common.h pydnspp_towire.h +libb10_pydnspp_la_SOURCES = pydnspp_common.cc pydnspp_common.h +libb10_pydnspp_la_SOURCES += pydnspp_config.h pydnspp_towire.h libb10_pydnspp_la_SOURCES += name_python.cc name_python.h libb10_pydnspp_la_SOURCES += nsec3hash_python.cc nsec3hash_python.h libb10_pydnspp_la_SOURCES += rrset_python.cc rrset_python.h diff --git a/src/lib/dns/python/pydnspp_common.h b/src/lib/dns/python/pydnspp_common.h index 8e498b3f93..9c27cfdae1 100644 --- a/src/lib/dns/python/pydnspp_common.h +++ b/src/lib/dns/python/pydnspp_common.h @@ -15,6 +15,8 @@ #ifndef LIBDNS_PYTHON_COMMON_H #define LIBDNS_PYTHON_COMMON_H 1 +#include <dns/python/pydnspp_config.h> + #include <Python.h> #include <boost/static_assert.hpp> @@ -60,11 +62,6 @@ int addClassVariable(PyTypeObject& c, const char* name, PyObject* obj); /// \return true on success, false on failure bool initClass(PyTypeObject& type, const char* name, PyObject* mod); -// Short term workaround for unifying the return type of tp_hash -#if PY_MINOR_VERSION < 2 -typedef long Py_hash_t; -#endif - /// \brief Convert a hash value of arbitrary type to a Python hash value. /// /// This templated function is a convenient wrapper to produce a valid hash diff --git a/src/lib/dns/python/pydnspp_config.h.in b/src/lib/dns/python/pydnspp_config.h.in new file mode 100644 index 0000000000..6326e8cb51 --- /dev/null +++ b/src/lib/dns/python/pydnspp_config.h.in @@ -0,0 +1,25 @@ +// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +#ifndef LIBDNS_PYTHON_CONFIG_H +#define LIBDNS_PYTHON_CONFIG_H 1 + +// Short term workaround for unifying the return type of tp_hash. +// Remove this test (and associated changes in configure.ac) when we +// require Python 3.2. +#if (!(@HAVE_PY_HASH_T@)) +typedef long Py_hash_t; +#endif + +#endif // LIBDNS_PYTHON_CONFIG_H |