Home | History | Annotate | Download | only in include
      1 /*---------------------------------------------------------------------------*
      2  *  caexcept.h  *
      3  *                                                                           *
      4  *  Copyright 2007, 2008 Nuance Communciations, Inc.                               *
      5  *                                                                           *
      6  *  Licensed under the Apache License, Version 2.0 (the 'License');          *
      7  *  you may not use this file except in compliance with the License.         *
      8  *                                                                           *
      9  *  You may obtain a copy of the License at                                  *
     10  *      http://www.apache.org/licenses/LICENSE-2.0                           *
     11  *                                                                           *
     12  *  Unless required by applicable law or agreed to in writing, software      *
     13  *  distributed under the License is distributed on an 'AS IS' BASIS,        *
     14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
     15  *  See the License for the specific language governing permissions and      *
     16  *  limitations under the License.                                           *
     17  *                                                                           *
     18  *---------------------------------------------------------------------------*/
     19 
     20 #ifndef _h_caexcept_
     21 #define _h_caexcept_
     22 
     23 #ifdef SET_RCSID
     24 static const char caexcept_h[] = "$Id: caexcept.h,v 1.1.10.2 2007/08/31 17:44:52 dahan Exp $";
     25 #endif
     26 
     27 
     28 #include "duk_err.h"
     29 
     30 
     31 #ifdef USE_EXCEPTION_HANDLING
     32 
     33 typedef crecXceptn CA_Exception;
     34 
     35 #define TRY_CA_EXCEPT try{
     36 
     37 #define BEG_CATCH_CA_EXCEPT }catch( CA_Exception* e ){
     38 
     39 #define END_CATCH_CA_EXCEPT( Obj )      \
     40   rethrow_crec_xception(e, (void*) Obj );     \
     41   }
     42 
     43 #else
     44 
     45 #define TRY_CA_EXCEPT
     46 
     47 #define BEG_CATCH_CA_EXCEPT if(0){
     48 
     49 #define END_CATCH_CA_EXCEPT( Obj ) }
     50 
     51 #endif
     52 
     53 
     54 #endif /* _h_caexcept_ */
     55