sl@0: // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32\euser\epoc\x86\uc_trp.cpp sl@0: // sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: sl@0: GLREF_C void Panic(TCdtPanic); sl@0: sl@0: #ifndef __LEAVE_EQUALS_THROW__ sl@0: sl@0: void DoLeave(TTrap*); sl@0: sl@0: void __stdcall DoTrap(TTrap* aFrame) sl@0: { sl@0: TTrapHandler* pH=Exec::PushTrapFrame(aFrame); sl@0: if (pH) sl@0: pH->Trap(); sl@0: } sl@0: sl@0: EXPORT_C void User::Leave(TInt aReason) sl@0: // sl@0: // Leave to the current control region. sl@0: // sl@0: { sl@0: TTrap* pF=Exec::PopTrapFrame(); sl@0: if (!pF) sl@0: ::Panic(EUserLeaveWithoutTrap); sl@0: *pF->iResult=aReason; sl@0: TTrapHandler* pH=pF->iHandler; sl@0: if (pH) sl@0: pH->Leave(aReason); sl@0: DoLeave(pF); sl@0: } sl@0: sl@0: #endif // !__LEAVE_EQUALS_THROW__