Ignore:
Timestamp:
Nov 21, 2005 4:57:02 PM (18 years ago)
Author:
bennylp
Message:

Changed syntax to support Windows SEH

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pjlib-test/exception.c

    r65 r68  
    6666static int test(void) 
    6767{ 
     68    int rc = 0; 
    6869    PJ_USE_EXCEPTION; 
    69     int rc = 0; 
    7070 
    7171    /* 
     
    7575        rc = rc; 
    7676    } 
    77     PJ_CATCH( ID_1 ) { 
    78         rc = -2; 
    79     } 
    80     PJ_DEFAULT { 
     77    PJ_CATCH_ANY { 
    8178        rc = -3; 
    8279    } 
     
    9693        rc = -10; 
    9794    } 
    98     PJ_CATCH( ID_1 ) { 
    99         if (!rc) rc = 0; 
    100     } 
    101     PJ_DEFAULT { 
     95    PJ_CATCH_ANY { 
    10296        int id = PJ_GET_EXCEPTION(); 
    103         PJ_LOG(3,("", "...error: got unexpected exception %d (%s)",  
    104                   id, pj_exception_id_name(id))); 
    105         if (!rc) rc = -20; 
     97        if (id != ID_1) { 
     98            PJ_LOG(3,("", "...error: got unexpected exception %d (%s)",  
     99                      id, pj_exception_id_name(id))); 
     100            if (!rc) rc = -20; 
     101        } 
    106102    } 
    107103    PJ_END; 
     
    118114        rc = -25; 
    119115    } 
    120     PJ_CATCH( ID_1 ) { 
    121         if (!rc) rc = -30; 
    122     } 
    123     PJ_CATCH( ID_2 ) { 
    124         if (!rc) rc = 0; 
    125     } 
    126     PJ_DEFAULT { 
    127         if (!rc) rc = -40; 
     116    PJ_CATCH_ANY { 
     117        switch (PJ_GET_EXCEPTION()) { 
     118        case ID_1: 
     119            if (!rc) rc = -30; break; 
     120        case ID_2: 
     121            if (!rc) rc = 0; break; 
     122        default: 
     123            if (!rc) rc = -40; 
     124            break; 
     125        } 
    128126    } 
    129127    PJ_END; 
     
    140138        rc = -50; 
    141139    } 
    142     PJ_CATCH( ID_2 ) { 
    143         if (!rc) rc = -60; 
    144     } 
    145     PJ_DEFAULT { 
    146         if (!rc) rc = 0; 
     140    PJ_CATCH_ANY { 
     141        switch (PJ_GET_EXCEPTION()) { 
     142        case ID_1: 
     143            if (!rc) rc = 0; 
     144            break; 
     145        default: 
     146            if (!rc) rc = -60; 
     147            break; 
     148        } 
    147149    } 
    148150    PJ_END; 
Note: See TracChangeset for help on using the changeset viewer.