Changeset 2877 in Sophya for trunk/SophyaProg


Ignore:
Timestamp:
Jan 3, 2006, 3:37:43 PM (20 years ago)
Author:
ansari
Message:

Portage/compilation sur AIX-XlC (regatta): Ajout protection ds tdynl.cc - Reza 3 Jan 2006

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaProg/Tests/tdynl.cc

    r2615 r2877  
    5151    PDynLinkMgr * dyl = PDynLinkMgr::BuildFromCFile(cfilename);
    5252    PrtTim(" End of Compile-Link ");
    53 
    54     MyDlFunctionOfXY f = (MyDlFunctionOfXY)dyl->GetFunction("myf_dyl"); 
    55     if (f != NULL) {
    56       cout << " DlFunction f dyl.GetFunction(myf_dyl) linked OK - calling f() " << endl;
    57       cout << "f(0,1)= " << f(0.,1.) << "  ?= testfunc_dynl(0,1)= " << testfunc_dynl(0.,1.) << endl;
    58       cout << "f(1,1)= " << f(1.,1.) << "  ?= testfunc_dynl(1,1)= " << testfunc_dynl(1.,1.) << endl;
    59       cout << "f(-1,2.5)= " << f(-1.,2.5) << "  ?= testfunc_dynl(-1,2.5)= " << testfunc_dynl(-1.,2.5) << endl;
    60     }
    61     else {
    62       cout << " ERROR linking DlFunction f !!! " << endl;
     53    if (dyl != NULL) {
     54      MyDlFunctionOfXY f = (MyDlFunctionOfXY)dyl->GetFunction("myf_dyl"); 
     55      if (f != NULL) {
     56        cout << " DlFunction f dyl.GetFunction(myf_dyl) linked OK - calling f() " << endl;
     57        cout << "f(0,1)= " << f(0.,1.) << "  ?= testfunc_dynl(0,1)= " << testfunc_dynl(0.,1.) << endl;
     58        cout << "f(1,1)= " << f(1.,1.) << "  ?= testfunc_dynl(1,1)= " << testfunc_dynl(1.,1.) << endl;
     59        cout << "f(-1,2.5)= " << f(-1.,2.5) << "  ?= testfunc_dynl(-1,2.5)= " << testfunc_dynl(-1.,2.5) << endl;
     60      }
     61      else {
     62        cout << " ERROR linking DlFunction f !!! " << endl;
     63      }
     64    delete dyl;
    6365    }
    64     delete dyl;
    65   } 
     66    else cout << " ERROR Creating shared object !!! " << endl;
     67  }
    6668 
    6769  catch (PThrowable & exc) {
Note: See TracChangeset for help on using the changeset viewer.