31
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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 |
|
|
21 |
#ifndef __LIBDBUS_WSD_MACROS_H__
|
|
22 |
#define __LIBDBUS_WSD_MACROS_H__
|
|
23 |
|
|
24 |
#if (defined(__SYMBIAN32__) && (defined(__WINSCW__) || defined(__WINS__)))
|
|
25 |
#if EMULATOR
|
|
26 |
#undef EMULATOR
|
|
27 |
#endif
|
|
28 |
#ifdef GET_DBUS_WSD_VAR_NAME
|
|
29 |
#undef GET_DBUS_WSD_VAR_NAME
|
|
30 |
#endif
|
|
31 |
|
|
32 |
#define EMULATOR (defined(__SYMBIAN32__) && (defined(__WINSCW__) || defined(__WINS__)))
|
|
33 |
#define GET_DBUS_WSD_VAR_NAME(var,filename,prefix) _##prefix##_##filename##_##var
|
|
34 |
|
|
35 |
#define RETURN_WSD_VAR(var,filename,prefix) (libdbus_ImpurePtr()->GET_DBUS_WSD_VAR_NAME(var,filename,prefix))
|
|
36 |
|
|
37 |
#define GET_WSD_VAR_FROM_TLS(var,filename,type,prefix)\
|
|
38 |
type *_##prefix##_##filename##_##var()\
|
|
39 |
{\
|
|
40 |
return (&RETURN_WSD_VAR(var,filename,prefix));\
|
|
41 |
}
|
|
42 |
|
|
43 |
#define GET_WSD_ARRAY_FROM_TLS(var,filename,type,prefix)\
|
|
44 |
type *_##prefix##_##filename##_##var()\
|
|
45 |
{\
|
|
46 |
return (RETURN_WSD_VAR(var,filename,prefix));\
|
|
47 |
}
|
|
48 |
|
|
49 |
#define VARIABLE_DECL(var,varprefix,filename,datatype)\
|
|
50 |
datatype GET_DBUS_WSD_VAR_NAME(var,filename,varprefix);
|
|
51 |
|
|
52 |
#define VARIABLE_DECL_ARRAY(var,prefix,filename,datatype,size) \
|
|
53 |
datatype GET_DBUS_WSD_VAR_NAME(var,filename,prefix)[size];
|
|
54 |
|
|
55 |
|
|
56 |
#define GET_STATIC_VAR_FROM_TLS(var,filename,type) GET_WSD_VAR_FROM_TLS(var,filename,type,s)
|
|
57 |
|
|
58 |
#define GET_GLOBAL_VAR_FROM_TLS(var,filename,type) GET_WSD_VAR_FROM_TLS(var,filename,type,g)
|
|
59 |
|
|
60 |
#define GET_STATIC_ARRAY_FROM_TLS(var,filename,type) GET_WSD_ARRAY_FROM_TLS(var,filename,type,s)
|
|
61 |
|
|
62 |
#define GET_GLOBAL_ARRAY_FROM_TLS(var,filename,type) GET_WSD_ARRAY_FROM_TLS(var,filename,type,g)
|
|
63 |
|
|
64 |
#endif
|
|
65 |
#endif //__LIBDBUS_WSD_MACROS_H__
|