case CORBA::tk_long : {
CORBA::Long l ;
data >>= l ;
- PyObject * ArgValue = Py_BuildValue( "l" , l ) ;
+// epa - Porting to 64-bit Linux:CORBA::Long is incorrectly treated as unsigned
+// integer by Py_BuildValue("l", val) in Python 2.4.1. Using Py_BuildValue("i",val)
+// seemsto help
+ PyObject * ArgValue = NULL;
+ if ( SIZEOF_LONG == 4 )
+ ArgValue = Py_BuildValue( "l" , l ) ;
+ else
+ ArgValue = Py_BuildValue( "i" , l ) ;
#if PyDynInvokeTrace
cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value " << l
<< " ArgValue->ob_refcnt" << ArgValue->ob_refcnt << endl ;