24
24
#pragma once
25
25
26
26
#include once "crt/long.bi"
27
- #include once "bits/wordsize.bi"
27
+
28
+ #ifdef __FB_ARM__
29
+ #include once "endian.bi"
30
+ # else
31
+ #include once "bits/wordsize.bi"
32
+ # endif
28
33
29
34
const _BITS_PTHREADTYPES_H = 1
30
35
31
- # if defined(__FB_64BIT__) and ( not defined(__FB_ARM__))
36
+ #ifndef __FB_64BIT__
37
+ const __SIZEOF_PTHREAD_ATTR_T = 36
38
+ const __SIZEOF_PTHREAD_MUTEX_T = 24
39
+ # elseif defined(__FB_64BIT__) and ( not defined(__FB_ARM__))
32
40
const __SIZEOF_PTHREAD_ATTR_T = 56
33
41
const __SIZEOF_PTHREAD_MUTEX_T = 40
42
+ # endif
43
+
44
+ # if defined(__FB_64BIT__) and defined(__FB_ARM__)
45
+ const __SIZEOF_PTHREAD_ATTR_T = 64
46
+ const __SIZEOF_PTHREAD_MUTEX_T = 48
47
+ const __SIZEOF_PTHREAD_MUTEXATTR_T = 8
34
48
# else
35
- const __SIZEOF_PTHREAD_ATTR_T = 36
36
- const __SIZEOF_PTHREAD_MUTEX_T = 24
49
+ const __SIZEOF_PTHREAD_MUTEXATTR_T = 4
37
50
# endif
38
51
39
- const __SIZEOF_PTHREAD_MUTEXATTR_T = 4
40
52
const __SIZEOF_PTHREAD_COND_T = 48
41
- const __SIZEOF_PTHREAD_CONDATTR_T = 4
42
53
43
- # if defined(__FB_64BIT__) and ( not defined(__FB_ARM__))
44
- const __SIZEOF_PTHREAD_RWLOCK_T = 56
45
- # else
54
+ # if ( not defined(__FB_64BIT__)) and defined(__FB_ARM__)
55
+ const __SIZEOF_PTHREAD_COND_COMPAT_T = 12
56
+ # endif
57
+
58
+ # if (defined(__FB_64BIT__) and ( not defined(__FB_ARM__))) or ( not defined(__FB_64BIT__))
59
+ const __SIZEOF_PTHREAD_CONDATTR_T = 4
60
+ # endif
61
+
62
+ #ifndef __FB_64BIT__
46
63
const __SIZEOF_PTHREAD_RWLOCK_T = 32
64
+ # elseif defined(__FB_64BIT__) and defined(__FB_ARM__)
65
+ const __SIZEOF_PTHREAD_COND_COMPAT_T = 48
66
+ const __SIZEOF_PTHREAD_CONDATTR_T = 8
67
+ # endif
68
+
69
+ #ifdef __FB_64BIT__
70
+ const __SIZEOF_PTHREAD_RWLOCK_T = 56
47
71
# endif
48
72
49
73
const __SIZEOF_PTHREAD_RWLOCKATTR_T = 8
50
74
51
- # if defined( __FB_64BIT__) and ( not defined(__FB_ARM__))
75
+ #ifdef __FB_64BIT__
52
76
const __SIZEOF_PTHREAD_BARRIER_T = 32
53
77
# else
54
78
const __SIZEOF_PTHREAD_BARRIER_T = 20
55
79
# endif
56
80
57
- const __SIZEOF_PTHREAD_BARRIERATTR_T = 4
81
+ # if defined(__FB_64BIT__) and defined(__FB_ARM__)
82
+ const __SIZEOF_PTHREAD_BARRIERATTR_T = 8
83
+ # else
84
+ const __SIZEOF_PTHREAD_BARRIERATTR_T = 4
85
+ # endif
86
+
58
87
type pthread_t as culong
59
88
60
89
union pthread_attr_t
61
- # if defined(__FB_64BIT__) and ( not defined(__FB_ARM__))
90
+ #ifndef __FB_64BIT__
91
+ __size as zstring * 36
92
+ # elseif defined(__FB_64BIT__) and ( not defined(__FB_ARM__))
62
93
__size as zstring * 56
63
94
# else
64
- __size as zstring * 36
95
+ __size as zstring * 64
65
96
# endif
66
97
67
98
__align as clong
68
99
end union
69
100
70
- const __have_pthread_attr_t = 1
71
-
72
- # if defined(__FB_64BIT__) and ( not defined(__FB_ARM__))
73
- type __pthread_internal_list
74
- __prev as __pthread_internal_list ptr
75
- __next as __pthread_internal_list ptr
76
- end type
101
+ # if (defined(__FB_64BIT__) and ( not defined(__FB_ARM__))) or ( not defined(__FB_64BIT__))
102
+ const __have_pthread_attr_t = 1
103
+ # endif
77
104
78
- type __pthread_list_t as __pthread_internal_list
79
- # else
105
+ #ifndef __FB_64BIT__
80
106
type __pthread_internal_slist
81
107
__next as __pthread_internal_slist ptr
82
108
end type
83
109
84
110
type __pthread_slist_t as __pthread_internal_slist
111
+ # endif
85
112
113
+ # if ( not defined(__FB_64BIT__)) and ( not defined(__FB_ARM__))
86
114
type pthread_mutex_t___pthread_mutex_s___elision_data
87
115
__espins as short
88
116
__elision as short
89
117
end type
118
+ # elseif defined(__FB_64BIT__) and defined(__FB_ARM__)
119
+ #define __have_pthread_attr_t1
120
+ # endif
121
+
122
+ #ifdef __FB_64BIT__
123
+ type __pthread_internal_list
124
+ __prev as __pthread_internal_list ptr
125
+ __next as __pthread_internal_list ptr
126
+ end type
127
+
128
+ type __pthread_list_t as __pthread_internal_list
90
129
# endif
91
130
92
131
type __pthread_mutex_s
93
132
__lock as long
94
133
__count as ulong
95
134
__owner as long
96
135
97
- # if defined( __FB_64BIT__) and ( not defined(__FB_ARM__))
136
+ #ifdef __FB_64BIT__
98
137
__nusers as ulong
99
138
# endif
100
139
101
140
__kind as long
102
141
103
- # if defined(__FB_64BIT__) and ( not defined(__FB_ARM__))
104
- __spins as short
105
- __elision as short
106
- __list as __pthread_list_t
107
- # else
142
+ #ifndef __FB_64BIT__
108
143
__nusers as ulong
109
144
110
145
union
111
- __elision_data as pthread_mutex_t___pthread_mutex_s___elision_data
146
+ # if ( not defined(__FB_64BIT__)) and ( not defined(__FB_ARM__))
147
+ __elision_data as pthread_mutex_t___pthread_mutex_s___elision_data
148
+ # elseif ( not defined(__FB_64BIT__)) and defined(__FB_ARM__)
149
+ __spins as long
150
+ # endif
151
+
112
152
__list as __pthread_slist_t
113
153
end union
154
+ # elseif defined(__FB_64BIT__) and ( not defined(__FB_ARM__))
155
+ __spins as short
156
+ __elision as short
157
+ # else
158
+ __spins as long
159
+ # endif
160
+
161
+ #ifdef __FB_64BIT__
162
+ __list as __pthread_list_t
114
163
# endif
115
164
end type
116
165
117
166
union pthread_mutex_t
118
167
__data as __pthread_mutex_s
119
168
120
- # if defined(__FB_64BIT__) and ( not defined(__FB_ARM__))
169
+ #ifndef __FB_64BIT__
170
+ __size as zstring * 24
171
+ # elseif defined(__FB_64BIT__) and ( not defined(__FB_ARM__))
121
172
__size as zstring * 40
122
173
# else
123
- __size as zstring * 24
174
+ __size as zstring * 48
124
175
# endif
125
176
126
177
__align as clong
127
178
end union
128
179
129
- # if defined(__FB_64BIT__) and ( not defined(__FB_ARM__))
130
- const __PTHREAD_MUTEX_HAVE_PREV = 1
131
- #define __PTHREAD_SPINS 0 , 0
132
- # else
180
+ # if ( not defined(__FB_64BIT__)) and ( not defined(__FB_ARM__))
133
181
#define __spins __elision_data.__espins
134
182
#define __elision __elision_data.__elision
135
183
#define __PTHREAD_SPINS ( 0 , 0 )
184
+ # elseif defined(__FB_64BIT__)
185
+ const __PTHREAD_MUTEX_HAVE_PREV = 1
186
+ # endif
187
+
188
+ # if defined(__FB_64BIT__) and ( not defined(__FB_ARM__))
189
+ #define __PTHREAD_SPINS 0 , 0
190
+ # elseif defined(__FB_ARM__)
191
+ const __PTHREAD_SPINS = 0
136
192
# endif
137
193
138
194
union pthread_mutexattr_t
139
- __size as zstring * 4
140
- __align as long
195
+ # if (defined(__FB_64BIT__) and ( not defined(__FB_ARM__))) or ( not defined(__FB_64BIT__))
196
+ __size as zstring * 4
197
+ # endif
198
+
199
+ #ifndef __FB_ARM__
200
+ __align as long
201
+ # elseif defined(__FB_64BIT__) and defined(__FB_ARM__)
202
+ __size as zstring * 8
203
+ # endif
204
+
205
+ #ifdef __FB_ARM__
206
+ __align as clong
207
+ # endif
141
208
end union
142
209
143
210
type pthread_cond_t___data
@@ -154,12 +221,26 @@ end type
154
221
union pthread_cond_t
155
222
__data as pthread_cond_t___data
156
223
__size as zstring * 48
157
- __align as longint
224
+
225
+ # if defined(__FB_64BIT__) and defined(__FB_ARM__)
226
+ __align as clong
227
+ # else
228
+ __align as longint
229
+ # endif
158
230
end union
159
231
160
232
union pthread_condattr_t
161
- __size as zstring * 4
162
- __align as long
233
+ # if defined(__FB_64BIT__) and defined(__FB_ARM__)
234
+ __size as zstring * 8
235
+ # else
236
+ __size as zstring * 4
237
+ # endif
238
+
239
+ # if ( not defined(__FB_64BIT__)) and defined(__FB_ARM__)
240
+ __align as clong
241
+ # else
242
+ __align as long
243
+ # endif
163
244
end union
164
245
165
246
type pthread_key_t as ulong
@@ -173,30 +254,39 @@ type pthread_rwlock_t___data
173
254
__nr_readers_queued as ulong
174
255
__nr_writers_queued as ulong
175
256
176
- # if defined( __FB_64BIT__) and ( not defined(__FB_ARM__))
257
+ #ifdef __FB_64BIT__
177
258
__writer as long
178
259
__shared as long
179
260
# else
180
261
__flags as ubyte
181
262
__shared as ubyte
182
263
# endif
183
264
184
- __rwelision as byte
265
+ #ifndef __FB_ARM__
266
+ __rwelision as byte
267
+ # elseif ( not defined(__FB_64BIT__)) and defined(__FB_ARM__)
268
+ __pad1 as ubyte
269
+ # endif
185
270
186
- # if defined(__FB_64BIT__) and ( not defined(__FB_ARM__))
271
+ #ifndef __FB_64BIT__
272
+ __pad2 as ubyte
273
+ __writer as long
274
+ # elseif defined(__FB_64BIT__) and ( not defined(__FB_ARM__))
187
275
__pad1( 0 to 6 ) as ubyte
276
+ # else
277
+ __pad1 as culong
278
+ # endif
279
+
280
+ #ifdef __FB_64BIT__
188
281
__pad2 as culong
189
282
__flags as ulong
190
- # else
191
- __pad2 as ubyte
192
- __writer as long
193
283
# endif
194
284
end type
195
285
196
286
union pthread_rwlock_t
197
287
__data as pthread_rwlock_t___data
198
288
199
- # if defined( __FB_64BIT__) and ( not defined(__FB_ARM__))
289
+ #ifdef __FB_64BIT__
200
290
__size as zstring * 56
201
291
# else
202
292
__size as zstring * 32
@@ -220,7 +310,7 @@ end union
220
310
type pthread_spinlock_t as long
221
311
222
312
union pthread_barrier_t
223
- # if defined( __FB_64BIT__) and ( not defined(__FB_ARM__))
313
+ #ifdef __FB_64BIT__
224
314
__size as zstring * 32
225
315
# else
226
316
__size as zstring * 20
@@ -230,6 +320,11 @@ union pthread_barrier_t
230
320
end union
231
321
232
322
union pthread_barrierattr_t
233
- __size as zstring * 4
323
+ # if defined(__FB_64BIT__) and defined(__FB_ARM__)
324
+ __size as zstring * 8
325
+ # else
326
+ __size as zstring * 4
327
+ # endif
328
+
234
329
__align as long
235
330
end union
0 commit comments