|
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 #ifndef __GMODULE_WSD_H__ |
|
21 #define __GMODULE_WSD_H__ |
|
22 |
|
23 #if (defined(__SYMBIAN32__) && (defined(__WINSCW__) || defined(__WINS__))) |
|
24 |
|
25 #include <_ansi.h> |
|
26 #include <sys/cdefs.h> |
|
27 #include <gmodule.h> |
|
28 |
|
29 /* -------------------------- MACRO DEFINATIONS ----------------------*/ |
|
30 #ifndef EMULATOR |
|
31 #define EMULATOR (defined(__SYMBIAN32__) && (defined(__WINSCW__) || defined(__WINS__))) |
|
32 #endif /* EMULATOR */ |
|
33 |
|
34 #define VARIABLE_NAME(var,filename) s_##filename##_##var |
|
35 |
|
36 #define FUNCTION_NAME(var,filename) _s_##filename##_##var |
|
37 |
|
38 #define VARIABLE_DECL(var,filename,datatype)\ |
|
39 datatype VARIABLE_NAME(var,filename); |
|
40 |
|
41 #define RETURN_VAL(var,filename) (Gmodule_ImpurePtr()->VARIABLE_NAME(var,filename)) |
|
42 |
|
43 #define PLS(var,filename,type) \ |
|
44 type *_s_##filename##_##var() \ |
|
45 { \ |
|
46 return &RETURN_VAL(var,filename);\ |
|
47 } |
|
48 /* -------------------------- END MACRO DEFINATIONS ----------------------*/ |
|
49 |
|
50 |
|
51 struct global_struct |
|
52 { |
|
53 VARIABLE_DECL(modules,gmodule,GModule *) |
|
54 VARIABLE_DECL(main_module,gmodule,GModule *) |
|
55 VARIABLE_DECL(module_error_private,gmodule,GStaticPrivate) |
|
56 VARIABLE_DECL(g_module_global_lock,gmodule,GStaticRecMutex) |
|
57 }; |
|
58 |
|
59 __BEGIN_DECLS |
|
60 struct global_struct *Gmodule_ImpurePtr(); |
|
61 __END_DECLS |
|
62 #endif |
|
63 |
|
64 #endif /* __GMODULE_WSD_H__ */ |