|
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 __GTHREAD_WSD_H__ |
|
21 #define __GTHREAD_WSD_H__ |
|
22 |
|
23 #if (defined(__SYMBIAN32__) && (defined(__WINSCW__) || defined(__WINS__))) |
|
24 |
|
25 #include <_ansi.h> |
|
26 #include <sys/cdefs.h> |
|
27 #include <gthread.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 VARIABLE_DECL_ARRAY(name,filename,datatype,size) \ |
|
42 datatype VARIABLE_NAME(name,filename)[size]; |
|
43 |
|
44 #define RETURN_VAL(var,filename) (Gthread_ImpurePtr()->VARIABLE_NAME(var,filename)) |
|
45 |
|
46 #define PLS(var,filename,type) \ |
|
47 type *FUNCTION_NAME(var,filename)() \ |
|
48 { \ |
|
49 return &RETURN_VAL(var,filename);\ |
|
50 } |
|
51 |
|
52 #define PLS_ARRAY(var,filename,type) \ |
|
53 type *FUNCTION_NAME(var,filename)() \ |
|
54 { \ |
|
55 return RETURN_VAL(var,filename);\ |
|
56 } |
|
57 /* ------------------------ END MACRO DEFINATIONS -------------------------*/ |
|
58 |
|
59 struct global_struct |
|
60 { |
|
61 VARIABLE_DECL(thread_system_already_initialized,gthread_impl,gboolean) |
|
62 VARIABLE_DECL_ARRAY(g_thread_priority_map,gthread_impl,gint,G_THREAD_PRIORITY_URGENT + 1) |
|
63 |
|
64 #ifdef G_ENABLE_DEBUG |
|
65 VARIABLE_DECL(posix_check_cmd_prio_warned,gthread_posix,gboolean) |
|
66 #endif /* G_ENABLE_DEBUG */ |
|
67 |
|
68 VARIABLE_DECL(priority_normal_value,gthread_posix,gint) |
|
69 VARIABLE_DECL(g_thread_min_stack_size ,gthread_posix,gulong) |
|
70 VARIABLE_DECL(g_thread_functions_for_glib_use_default ,gthread_posix,GThreadFunctions) |
|
71 }; |
|
72 |
|
73 __BEGIN_DECLS |
|
74 struct global_struct *Gthread_ImpurePtr(); |
|
75 __END_DECLS |
|
76 #endif |
|
77 |
|
78 #endif /* __GTHREAD_WSD_H__ */ |