os/ossrv/genericopenlibs/liboil/inc/liboil_wsd_macro.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/liboil/inc/liboil_wsd_macro.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,64 @@
     1.4 +/*
     1.5 +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 + 
    1.21 +
    1.22 +
    1.23 +#ifndef __LIBOIL_WSD_MACROS_H__
    1.24 +#define __LIBOIL_WSD_MACROS_H__
    1.25 +
    1.26 +#if (defined(__SYMBIAN32__) && (defined(__WINSCW__) || defined(__WINS__)))
    1.27 +#if EMULATOR
    1.28 +#undef EMULATOR
    1.29 +#endif
    1.30 +#ifdef GET_OIL_WSD_VAR_NAME
    1.31 +#undef GET_OIL_WSD_VAR_NAME
    1.32 +#endif
    1.33 +
    1.34 +#define EMULATOR (defined(__SYMBIAN32__) && (defined(__WINSCW__) || defined(__WINS__)))
    1.35 +#define GET_OIL_WSD_VAR_NAME(var,filename,prefix)     _##prefix##_##filename##_##var
    1.36 +
    1.37 +#define RETURN_WSD_VAR(var,filename,prefix) (libOIL_ImpurePtr()->GET_OIL_WSD_VAR_NAME(var,filename,prefix))
    1.38 +
    1.39 +#define GET_WSD_VAR_FROM_TLS(var,filename,type,prefix)\
    1.40 +type *_##prefix##_##filename##_##var()\
    1.41 +{\
    1.42 +    return (&RETURN_WSD_VAR(var,filename,prefix));\
    1.43 +}
    1.44 +
    1.45 +#define GET_WSD_ARRAY_FROM_TLS(var,filename,type,prefix)\
    1.46 +type *_##prefix##_##filename##_##var()\
    1.47 +{\
    1.48 +    return (RETURN_WSD_VAR(var,filename,prefix));\
    1.49 +}
    1.50 +
    1.51 +#define VARIABLE_DECL(var,varprefix,filename,datatype)\
    1.52 +datatype GET_OIL_WSD_VAR_NAME(var,filename,varprefix);
    1.53 +
    1.54 +#define VARIABLE_DECL_ARRAY(var,prefix,filename,datatype,size) \
    1.55 +datatype GET_OIL_WSD_VAR_NAME(var,filename,prefix)[size];
    1.56 +
    1.57 +
    1.58 +#define GET_STATIC_VAR_FROM_TLS(var,filename,type)      GET_WSD_VAR_FROM_TLS(var,filename,type,s)
    1.59 +
    1.60 +#define GET_GLOBAL_VAR_FROM_TLS(var,filename,type)  GET_WSD_VAR_FROM_TLS(var,filename,type,g)
    1.61 +
    1.62 +#define GET_STATIC_ARRAY_FROM_TLS(var,filename,type)    GET_WSD_ARRAY_FROM_TLS(var,filename,type,s)
    1.63 +
    1.64 +#define GET_GLOBAL_ARRAY_FROM_TLS(var,filename,type)    GET_WSD_ARRAY_FROM_TLS(var,filename,type,g)
    1.65 +
    1.66 +#endif
    1.67 +#endif      //__LIBOIL_WSD_MACROS_H__