diff -r 000000000000 -r a41df078684a kernel/eka/include/win32crt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kernel/eka/include/win32crt.h Mon Oct 19 15:55:17 2009 +0100 @@ -0,0 +1,164 @@ +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// e32\include\win32crt.h +// +// + +/** + @file + @internalTechnology +*/ + +typedef void (__cdecl *_PVFV)(void); +typedef void* HANDLE; + + +// +// Static construction / destruction depends on compiler +// + +// GCC creates two lists of functions to call, __CTOR_LIST__ and __DTOR_LIST__ +#if defined(__GCC32__) +typedef void (*PFV)(); +extern PFV __CTOR_LIST__[]; +extern PFV __DTOR_LIST__[]; +static inline void constructStatics() + { + TUint _i=1; + while (__CTOR_LIST__[_i]) + (*__CTOR_LIST__[_i++])(); + } +static inline void destroyStatics() + { + TUint _i=1; + while (__DTOR_LIST__[_i]) + (*__DTOR_LIST__[_i++])(); + } + +// VC puts constructor/destructor function pointers in specially-named sections +#else +#pragma data_seg(".CRT$XIA") +_PVFV __xi_a[] = { NULL }; +#pragma data_seg(".CRT$XIZ") +_PVFV __xi_z[] = { NULL }; +#pragma data_seg(".CRT$XCA") +_PVFV __xc_a[] = { NULL }; +#pragma data_seg(".CRT$XCZ") +_PVFV __xc_z[] = { NULL }; +#pragma data_seg(".CRT$XPA") +_PVFV __xp_a[] = { NULL }; +#pragma data_seg(".CRT$XPZ") +_PVFV __xp_z[] = { NULL }; +#pragma data_seg(".CRT$XTA") +_PVFV __xt_a[] = { NULL }; +#pragma data_seg(".CRT$XTZ") +_PVFV __xt_z[] = { NULL }; +#pragma data_seg() /* reset */ +LOCAL_C void invokeTable(_PVFV *aStart,_PVFV *aEnd) + { + while (aStart