wlav committed 2b8e6b3

fragile tests now work with CINT backend

  • Participants
  • Parent commits bd16dfb
  • Branches reflex-support

Comments (0)

Files changed (4)


 from pypy.translator.tool.cbuild import ExternalCompilationInfo
 from pypy.rpython.lltypesystem import rffi
-from pypy.rlib import rdynload
+from pypy.rlib import libffi, rdynload
 __all__ = ['eci', 'c_load_dictionary']
-c_load_dictionary = rffi.llexternal(
+_c_load_dictionary = rffi.llexternal(
     [rffi.CCHARP], rdynload.DLLHANDLE,
+def c_load_dictionary(name):
+    result = _c_load_dictionary(name)
+    if not result:
+        err = rdynload.dlerror()
+        raise rdynload.DLOpenError(err)
+    return libffi.CDLL(name)       # should return handle to already open file


 /*  CINT internals (won't work on Windwos) ------------------------------- */
 extern long G__store_struct_offset;
-extern "C" void* G__GetShlHandle();
+extern "C" void* G__SetShlHandle(char*);
 /* data for life time management ------------------------------------------ */
 typedef std::vector<TClassRef> ClassRefs_t;
     if (!cr.GetClass())
         return (cppyy_typehandle_t)NULL;
+    if (!cr->GetClassInfo())
+        return (cppyy_typehandle_t)NULL;
     if (!G__TypeInfo(class_name).IsValid())
         return (cppyy_typehandle_t)NULL;
 void* cppyy_load_dictionary(const char* lib_name) {
-    if (gSystem->Load(lib_name))
-       return (void*)G__GetShlHandle();
-    return (void*)0;
+   if (0 <= gSystem->Load(lib_name))
+      return (void*)1;
+   return (void*)0;


 # rootcint -f advancedcpp_cint.cxx -c advancedcpp.h advancedcpp_LinkDef.h
 # g++ -I$ROOTSYS/include advancedcpp_cint.cxx advancedcpp.cxx -shared -o -rdynamic
+# rootcint -f fragile_cint.cxx -c fragile.h fragile_LinkDef.h
+# g++ -I$ROOTSYS/include fragile_cint.cxx fragile.cxx -shared -o -rdynamic
+# rootcint -f stltypes_cint.cxx -c stltypes.h stltypes_LinkDef.h
+# g++ -I$ROOTSYS/include stltypes_cint.cxx stltypes.cxx -shared -o -rdynamic
 # TODO: methptrgetter causes these tests to crash, so don't use it for now stltypes.cxx stltypes.h stltypes.xml


+#ifdef __CINT__
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+#pragma link C++ namespace fragile;
+#pragma link C++ class fragile::A;
+#pragma link C++ class fragile::B;
+#pragma link C++ class fragile::C;
+#pragma link C++ class fragile::D;
+#pragma link C++ class fragile::E;
+#pragma link C++ class fragile::F;