//******************************************************************************
//
// Restricted Rights
// WARNING: This is a restricted distribution Zeligsoft file.
//
//******************************************************************************
//
// Copyright (C) 2006 Zeligsoft Inc. - All Rights Reserved
//

//******************************************************************************
//
//     FILE: zceCorbaExceptionMacros.h
//
//******************************************************************************

#ifndef __ZCECORBAEXCEPTIONMACROS_H
#define __ZCECORBAEXCEPTIONMACROS_H

	#define ZCE_EXC_ENV 
	
	#define ZCE_EXC_ENV_ARG 
	#define ZCE_EXC_ENV_SINGLE_ARG 
	#define ZCE_EXC_ENV_ARG_WITH_DEFAULT 
	#define ZCE_EXC_ENV_SINGLE_ARG_WITH_DEFAULT 
	
	#define ZCE_MACRO_ENV_ARG 0/*we use an integer that gets ignored*/ 
	
	#define ZCE_EXC_ENV_PARAM 
	#define ZCE_EXC_ENV_SINGLE_PARAM 
	
	#define ZCE_EXC_TRY {\
		bool _zce_exc_got_it = false; if(_zce_exc_got_it == true){_zce_exc_got_it = false;} /*Second part of this line is to avoid compiler warnings about an unused variable */\
		try\
		{
	
	#define ZCE_EXC_CATCH(CLASS, VAR) \
		} catch (CLASS & VAR) { _zce_exc_got_it = true;\
	
	#define ZCE_EXC_CATCHTYPE(CLASS) \
		} catch (CLASS &) { _zce_exc_got_it = true;\
	
	#define ZCE_EXC_CATCHANY \
		} catch (...) { _zce_exc_got_it = true;\
	
	#define ZCE_EXC_NONE \
		} if (!_zce_exc_got_it) {\
	
	#define ZCE_EXC_ENDTRY(RC) \
		} }	
	#define ZCE_EXC_ENDTRY_VOID \
		} }	
	#define ZCE_EXC_THROW(EXCEPTYPE,CONSPARAMS) { throw EXCEPTYPE CONSPARAMS; }
	#define ZCE_EXC_THROW_VOID(EXCEPTYPE,CONSPARAMS) { throw EXCEPTYPE CONSPARAMS; }
	#define ZCE_EXC_THROW_RC(EXCEPTYPE,CONSPARAMS,RC) { throw EXCEPTYPE CONSPARAMS; }
	
	#define ZCE_EXC_RETHROW { throw; }
	#define ZCE_EXC_RETHROW_VOID { throw; }
	#define ZCE_EXC_RETHROW_RC(RC) { throw; }
	
	#define ZCE_ASSERT_EXCEPTION(RC) void* p=(void*)&RC;if(p != NULL) {p=NULL;} /*This ensure no warning is generated for RC if it is instantiated just for the assertion */
	
	#define ZCE_ASSERT_EXCEPTION_VOID
	
#endif     // __ZCECORBAEXCEPTIONMACROS_H

// End-Of-File
//------------------------------------------------------------------------------
