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\arm\uc_dll.cpp sl@0: // This file contains the DLL entrypoint sl@0: // sl@0: // sl@0: sl@0: #include "u32std.h" sl@0: sl@0: sl@0: extern "C" { sl@0: sl@0: #if defined(__GCC32__) sl@0: sl@0: typedef void (*PFV)(); sl@0: extern PFV __CTOR_LIST__[]; sl@0: extern PFV __DTOR_LIST__[]; sl@0: sl@0: GLDEF_C TInt _E32Dll_Body(TInt aReason) sl@0: { sl@0: if (aReason==KModuleEntryReasonProcessAttach) sl@0: { sl@0: TUint i=1; sl@0: while (__CTOR_LIST__[i]) sl@0: (*__CTOR_LIST__[i++])(); sl@0: } sl@0: else if (aReason==KModuleEntryReasonProcessDetach) sl@0: { sl@0: TUint i=1; sl@0: while (__DTOR_LIST__[i]) sl@0: (*__DTOR_LIST__[i++])(); sl@0: } sl@0: return 0; sl@0: } sl@0: sl@0: #elif defined(__ARMCC__) sl@0: sl@0: void __DLL_Export_Table__(void); sl@0: void __cpp_initialize__aeabi_(void); sl@0: __weak void run_static_dtors(void); sl@0: sl@0: GLDEF_C TInt _E32Dll_Body(TInt aReason) sl@0: { sl@0: if (aReason==KModuleEntryReasonProcessAttach) sl@0: { sl@0: __DLL_Export_Table__(); sl@0: __cpp_initialize__aeabi_(); sl@0: } sl@0: else if (aReason==KModuleEntryReasonProcessDetach) sl@0: { sl@0: int call_static_dtors = (int)run_static_dtors; sl@0: if (call_static_dtors) run_static_dtors(); sl@0: return KErrNone; sl@0: } sl@0: return 0; sl@0: } sl@0: sl@0: #else sl@0: #error not supported sl@0: #endif sl@0: sl@0: } // extern "C" sl@0: