diff options
author | Mark Spruiell <mes@zeroc.com> | 2007-09-20 07:01:21 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2007-09-20 07:01:21 -0700 |
commit | 0e94720ebe843fa6692dd2d411a48428281ce97c (patch) | |
tree | 8a3e1975c272d5fe67970e5a4d9b72e9d9690271 /py/modules/IcePy/Operation.cpp | |
parent | changing struct __eq__ to __cmp___; check for None (diff) | |
download | ice-0e94720ebe843fa6692dd2d411a48428281ce97c.tar.bz2 ice-0e94720ebe843fa6692dd2d411a48428281ce97c.tar.xz ice-0e94720ebe843fa6692dd2d411a48428281ce97c.zip |
fix for compilation errors with Python 2.5
Diffstat (limited to 'py/modules/IcePy/Operation.cpp')
-rw-r--r-- | py/modules/IcePy/Operation.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/py/modules/IcePy/Operation.cpp b/py/modules/IcePy/Operation.cpp index 38afb5358e0..523f5143c1f 100644 --- a/py/modules/IcePy/Operation.cpp +++ b/py/modules/IcePy/Operation.cpp @@ -1460,9 +1460,15 @@ OperationInvoke::invoke(const Ice::ObjectPrx& proxy, PyObject* args, PyObject*) PyObjectHandle modeValue = PyObject_GetAttrString(mode, STRCAST("value")); Ice::OperationMode sendMode = (Ice::OperationMode)static_cast<int>(PyInt_AS_LONG(modeValue.get())); +#if PY_VERSION_HEX < 0x02050000 const Ice::Byte* mem; Py_ssize_t sz = inParams->ob_type->tp_as_buffer->bf_getcharbuffer( inParams, 0, reinterpret_cast<const char**>(&mem)); +#else + Ice::Byte* mem; + Py_ssize_t sz = inParams->ob_type->tp_as_buffer->bf_getcharbuffer( + inParams, 0, reinterpret_cast<char**>(&mem)); +#endif // Use the array API to avoid copying the data. const pair<const ::Ice::Byte*, const ::Ice::Byte*> in(mem, mem+sz); @@ -1551,9 +1557,15 @@ OperationInvoke::invokeAsync(const Ice::ObjectPrx& proxy, PyObject* args, PyObje PyObjectHandle modeValue = PyObject_GetAttrString(mode, STRCAST("value")); Ice::OperationMode sendMode = (Ice::OperationMode)static_cast<int>(PyInt_AS_LONG(modeValue.get())); +#if PY_VERSION_HEX < 0x02050000 const Ice::Byte* mem; Py_ssize_t sz = inParams->ob_type->tp_as_buffer->bf_getcharbuffer( inParams, 0, reinterpret_cast<const char**>(&mem)); +#else + Ice::Byte* mem; + Py_ssize_t sz = inParams->ob_type->tp_as_buffer->bf_getcharbuffer( + inParams, 0, reinterpret_cast<char**>(&mem)); +#endif // Use the array API to avoid copying the data. const pair<const ::Ice::Byte*, const ::Ice::Byte*> in(mem, mem+sz); @@ -1757,8 +1769,13 @@ OperationInvoke::sendResponse(const Ice::AMD_Array_Object_ice_invokePtr& cb, PyO throw Ice::MarshalException(__FILE__, __LINE__); } +#if PY_VERSION_HEX < 0x02050000 const Ice::Byte* mem; Py_ssize_t sz = arg->ob_type->tp_as_buffer->bf_getcharbuffer(arg, 0, reinterpret_cast<const char**>(&mem)); +#else + Ice::Byte* mem; + Py_ssize_t sz = arg->ob_type->tp_as_buffer->bf_getcharbuffer(arg, 0, reinterpret_cast<char**>(&mem)); +#endif const pair<const ::Ice::Byte*, const ::Ice::Byte*> bytes(mem, mem+sz); AllowThreads allowThreads; // Release Python's global interpreter lock during blocking calls. |