summaryrefslogtreecommitdiff
path: root/libs/python/src/long.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/python/src/long.cpp')
-rw-r--r--libs/python/src/long.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/libs/python/src/long.cpp b/libs/python/src/long.cpp
index fcba9d4..1ec8ebc 100644
--- a/libs/python/src/long.cpp
+++ b/libs/python/src/long.cpp
@@ -8,16 +8,16 @@ namespace boost { namespace python { namespace detail {
new_non_null_reference long_base::call(object const& arg_)
{
- union { PyTypeObject *ptop; PyObject *pop; }pun = { &PyLong_Type };
return (detail::new_non_null_reference)PyObject_CallFunction(
- pun.pop, const_cast<char*>("(O)"), arg_.ptr());
+ (PyObject*)&PyLong_Type, const_cast<char*>("(O)"),
+ arg_.ptr());
}
new_non_null_reference long_base::call(object const& arg_, object const& base)
{
- union { PyTypeObject *ptop; PyObject *pop; }pun = { &PyLong_Type };
return (detail::new_non_null_reference)PyObject_CallFunction(
- pun.pop, const_cast<char*>("(OO)"), arg_.ptr(), base.ptr());
+ (PyObject*)&PyLong_Type, const_cast<char*>("(OO)"),
+ arg_.ptr(), base.ptr());
}
long_base::long_base()
@@ -25,12 +25,7 @@ long_base::long_base()
detail::new_reference(
PyObject_CallFunction((PyObject*)&PyLong_Type, const_cast<char*>("()")))
)
-{
- union { PyTypeObject *ptop; PyObject *pop; }pun = { &PyLong_Type };
- object(detail::new_reference(
- PyObject_CallFunction(pun.pop, const_cast<char*>("()"))));
-}
-
+{}
long_base::long_base(object_cref arg)
: object(long_base::call(arg))