genericopenlibs/liboil/inc/liboil_wsd_macro.h
changeset 18 47c74d1534e1
equal deleted inserted replaced
0:e4d67989cc36 18:47c74d1534e1
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17  
       
    18 
       
    19 
       
    20 #ifndef __LIBOIL_WSD_MACROS_H__
       
    21 #define __LIBOIL_WSD_MACROS_H__
       
    22 
       
    23 #if (defined(__SYMBIAN32__) && (defined(__WINSCW__) || defined(__WINS__)))
       
    24 #if EMULATOR
       
    25 #undef EMULATOR
       
    26 #endif
       
    27 #ifdef GET_OIL_WSD_VAR_NAME
       
    28 #undef GET_OIL_WSD_VAR_NAME
       
    29 #endif
       
    30 
       
    31 #define EMULATOR (defined(__SYMBIAN32__) && (defined(__WINSCW__) || defined(__WINS__)))
       
    32 #define GET_OIL_WSD_VAR_NAME(var,filename,prefix)     _##prefix##_##filename##_##var
       
    33 
       
    34 #define RETURN_WSD_VAR(var,filename,prefix) (libOIL_ImpurePtr()->GET_OIL_WSD_VAR_NAME(var,filename,prefix))
       
    35 
       
    36 #define GET_WSD_VAR_FROM_TLS(var,filename,type,prefix)\
       
    37 type *_##prefix##_##filename##_##var()\
       
    38 {\
       
    39     return (&RETURN_WSD_VAR(var,filename,prefix));\
       
    40 }
       
    41 
       
    42 #define GET_WSD_ARRAY_FROM_TLS(var,filename,type,prefix)\
       
    43 type *_##prefix##_##filename##_##var()\
       
    44 {\
       
    45     return (RETURN_WSD_VAR(var,filename,prefix));\
       
    46 }
       
    47 
       
    48 #define VARIABLE_DECL(var,varprefix,filename,datatype)\
       
    49 datatype GET_OIL_WSD_VAR_NAME(var,filename,varprefix);
       
    50 
       
    51 #define VARIABLE_DECL_ARRAY(var,prefix,filename,datatype,size) \
       
    52 datatype GET_OIL_WSD_VAR_NAME(var,filename,prefix)[size];
       
    53 
       
    54 
       
    55 #define GET_STATIC_VAR_FROM_TLS(var,filename,type)      GET_WSD_VAR_FROM_TLS(var,filename,type,s)
       
    56 
       
    57 #define GET_GLOBAL_VAR_FROM_TLS(var,filename,type)  GET_WSD_VAR_FROM_TLS(var,filename,type,g)
       
    58 
       
    59 #define GET_STATIC_ARRAY_FROM_TLS(var,filename,type)    GET_WSD_ARRAY_FROM_TLS(var,filename,type,s)
       
    60 
       
    61 #define GET_GLOBAL_ARRAY_FROM_TLS(var,filename,type)    GET_WSD_ARRAY_FROM_TLS(var,filename,type,g)
       
    62 
       
    63 #endif
       
    64 #endif      //__LIBOIL_WSD_MACROS_H__