1.1 --- a/epoc32/include/stdapis/stdarg_e.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/stdapis/stdarg_e.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,60 @@
1.4 -stdarg_e.h
1.5 +/*
1.6 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +* Redistribution and use in source and binary forms, with or without
1.20 +* modification, are permitted provided that the following conditions are met:
1.21 +* Redistributions of source code must retain the above copyright notice, this
1.22 +* list of conditions and the following disclaimer.
1.23 +* Redistributions in binary form must reproduce the above copyright notice,
1.24 +* this list of conditions and the following disclaimer in the documentation
1.25 +* and/or other materials provided with the distribution.
1.26 +* Neither the name of the <ORGANIZATION> nor the names of its contributors
1.27 +* may be used to endorse or promote products derived from this software
1.28 +* without specific prior written permission.
1.29 +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1.30 +* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1.31 +* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1.32 +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
1.33 +* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1.34 +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
1.35 +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
1.36 +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
1.37 +* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1.38 +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1.39 +* This is all somewhat tortured because ANSI C says that stdio.h is not supposed
1.40 +* to define va_list: it needs to have access to that data type, but must not use that name.
1.41 +* Instead stdio.h should use an __ name, which is safe because it is reserved for
1.42 +* the implementation. Hence __e32_va_list.
1.43 +*
1.44 +*
1.45 +*/
1.46 +
1.47 +
1.48 +
1.49 +
1.50 +
1.51 +
1.52 +#ifndef _STDARG_E_H
1.53 +#define _STDARG_E_H
1.54 +
1.55 +/**
1.56 +EPOC32 definitions, extracted from E32DEFS.H
1.57 +*/
1.58 +typedef char* __e32_va_list;
1.59 +
1.60 +#define va_start(ap,pn) (ap=(__e32_va_list)&pn+((sizeof(pn)+sizeof(int)-1)&~(sizeof(int)-1)),(void)0)
1.61 +#define va_arg(ap,type) (ap+=((sizeof(type)+sizeof(int)-1)&~(sizeof(int)-1)),(*(type *)(ap-((sizeof(type)+sizeof(int)-1)&~(sizeof(int)-1)))))
1.62 +#define va_end(ap) (ap=0,(void)0)
1.63 +
1.64 +#endif