Skip to content
Snippets Groups Projects
Commit dcf4119b authored by Wim Lavrijsen's avatar Wim Lavrijsen
Browse files

Cling workaround: special case to resolve string <-> basic_string<char>

parent 1d3b46cc
Branches
Tags
No related merge requests found
...@@ -504,7 +504,7 @@ Bool_t PyROOT::TCStringConverter::SetArg( ...@@ -504,7 +504,7 @@ Bool_t PyROOT::TCStringConverter::SetArg(
// set the value and declare success // set the value and declare success
if ( func ) if ( func )
gInterpreter->CallFunc_SetArg( func, reinterpret_cast< Long_t >( fBuffer.c_str() ) ); gInterpreter->CallFunc_SetArg( func, (Long_t)fBuffer.c_str() );
return kTRUE; return kTRUE;
} }
......
...@@ -230,8 +230,15 @@ int PyROOT::BuildRootClassDict( const TScopeAdapter& klass, PyObject* pyclass ) ...@@ -230,8 +230,15 @@ int PyROOT::BuildRootClassDict( const TScopeAdapter& klass, PyObject* pyclass )
// special case trackers // special case trackers
Bool_t setupSetItem = kFALSE; Bool_t setupSetItem = kFALSE;
Bool_t isConstructor = // CLING WORKAROUND --
TClassEdit::ShortType( mtName.c_str(), TClassEdit::kDropAlloc ) == clName; Bool_t isConstructor = kFALSE;
if ( clName == "string" ) {
isConstructor = mtName == "basic_string<char>";
} else {
// -- CLING WORKAROUND
isConstructor =
TClassEdit::ShortType( mtName.c_str(), TClassEdit::kDropAlloc ) == clName;
}
// filter empty names (happens for namespaces, is bug?) // filter empty names (happens for namespaces, is bug?)
if ( mtName == "" ) if ( mtName == "" )
......
...@@ -86,8 +86,10 @@ PyObject* PyROOT::TConstructorHolder::operator()( ...@@ -86,8 +86,10 @@ PyObject* PyROOT::TConstructorHolder::operator()(
// CLING WORKAROUND -- // CLING WORKAROUND --
// Due to #100389, the constructor may not be a valid method. This happens if // Due to #100389, the constructor may not be a valid method. This happens if
// there is no (default) contructor, so just return a right-size bit of memory. // there is no (default) contructor, so just return a right-size bit of memory.
if ( ! address ) if ( ! address ) {
PyErr_Clear();
address = (Long_t)klass->New(); address = (Long_t)klass->New();
}
// -- END CLING WORKAROUND // -- END CLING WORKAROUND
// done with filtered args // done with filtered args
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment