1 /* libtelepathy_wsd_macros.h |
|
2 * |
|
3 * |
|
4 * Copyright (C) 2008 Nokia Corporation. |
|
5 * This library is free software; you can redistribute it and/or |
|
6 * modify it under the terms of the GNU Lesser General Public |
|
7 * License as published by the Free Software Foundation; either |
|
8 * version 2.1 of the License, or (at your option) any later version. |
|
9 * |
|
10 * This library is distributed in the hope that it will be useful, |
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 * Lesser General Public License for more details. |
|
14 * |
|
15 * You should have received a copy of the GNU Lesser General Public |
|
16 * License along with this library; if not, write to the Free Software |
|
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef _LIBTELEPATHY_WSD_DEFS_H_ |
|
23 #define _LIBTELEPATHY_WSD_DEFS_H_ |
|
24 |
|
25 #if (defined(SYMBIAN) && (defined(__WINSCW__) || defined(__WINS__))) |
|
26 #if EMULATOR |
|
27 #undef EMULATOR |
|
28 #endif |
|
29 #ifdef GET_WSD_VAR_NAME |
|
30 #undef GET_WSD_VAR_NAME |
|
31 #endif |
|
32 |
|
33 #define EMULATOR (defined(SYMBIAN) && (defined(__WINSCW__) || defined(__WINS__))) |
|
34 #define GET_WSD_VAR_NAME(var,filename,prefix) _##prefix##_##filename##_##var |
|
35 |
|
36 #define RETURN_WSD_VAR(var,filename,prefix) (libtelepathy_ImpurePtr()->GET_WSD_VAR_NAME(var,filename,prefix)) |
|
37 |
|
38 #define GET_WSD_VAR_FROM_TLS(var,filename,type,prefix)\ |
|
39 type *_##prefix##_##filename##_##var()\ |
|
40 {\ |
|
41 return (&RETURN_WSD_VAR(var,filename,prefix));\ |
|
42 } |
|
43 |
|
44 #define GET_WSD_ARRAY_FROM_TLS(var,filename,type,prefix)\ |
|
45 type *_##prefix##_##filename##_##var()\ |
|
46 {\ |
|
47 return (RETURN_WSD_VAR(var,filename,prefix));\ |
|
48 } |
|
49 |
|
50 #define VARIABLE_DECL(var,varprefix,filename,datatype)\ |
|
51 datatype GET_WSD_VAR_NAME(var,filename,varprefix); |
|
52 |
|
53 #define VARIABLE_DECL_ARRAY(var,prefix,filename,datatype,size) \ |
|
54 datatype GET_WSD_VAR_NAME(var,filename,prefix)[size]; |
|
55 |
|
56 |
|
57 #define GET_STATIC_VAR_FROM_TLS(var,filename,type) GET_WSD_VAR_FROM_TLS(var,filename,type,s) |
|
58 |
|
59 #define GET_GLOBAL_VAR_FROM_TLS(var,filename,type) GET_WSD_VAR_FROM_TLS(var,filename,type,g) |
|
60 |
|
61 #define GET_STATIC_ARRAY_FROM_TLS(var,filename,type) GET_WSD_ARRAY_FROM_TLS(var,filename,type,s) |
|
62 |
|
63 #define GET_GLOBAL_ARRAY_FROM_TLS(var,filename,type) GET_WSD_ARRAY_FROM_TLS(var,filename,type,g) |
|
64 |
|
65 #endif |
|
66 #endif //_LIBTELEPATHY_WSD_DEFS_H_ |
|