7#include <QtCore/qcompilerdetection.h>
8#include <QtCore/qsystemdetection.h>
9#include <QtCore/qprocessordetection.h>
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
43
44
45
46
47
48
51
52
53
54
57
58
59
60
63
64
65
66
69
70
71
72
75
76
77
78
79
82
83
84
85
86
87
90
91
92
93
94
97
98
99
100
101
102
105
106
107
108
109
112
113
114
115
116
117
120
121
122
123
124
125
126
127
128
129
130
133
134
135
136
137
138
139
140
141
142
143
144
145
148
149
150
151
152
153
154
155
156
157
158
161
162
163
164
165
166
167
168
169
170
171
174
175
176
177
178
179
180
181
182
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
214
215
216
217
218
219
220
223
224
225
226
227
228
229
230
233
234
235
236
237
238
239
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
276
277
278
279
280
281
282
283
284
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
314
315
316
317
318
319
320
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
349
350
351
352
353
354
355
358
359
360
361
362
363
364
365
366
367
368
371
372
373
374
375
376
377
378
379
380
381
384
385
386
387
388
389
390
391
392
393
394
395
396
399
400
401
402
403
404
405
406
407
408
409
410
411
414
415
416
417
418
419
420
421
422
423
424
425
426
427
430
431
432
433
434
435
436
437
438
439
440
443
444
445
446
447
448
449
450
451
452
453
459static_assert(UCHAR_MAX == 255,
"Qt assumes that char is 8 bits");
460static_assert(
sizeof(
int) == 4,
"Qt assumes that int is 32 bits");
461static_assert(QT_POINTER_SIZE ==
sizeof(
void *),
"QT_POINTER_SIZE defined incorrectly");
462static_assert(
sizeof(
float) == 4,
"Qt assumes that float is 32 bits");
463static_assert(
sizeof(
char16_t) == 2,
"Qt assumes that char16_t is 16 bits");
464static_assert(
sizeof(
char32_t) == 4,
"Qt assumes that char32_t is 32 bits");
466static_assert(
sizeof(
wchar_t) ==
sizeof(
char16_t));
468static_assert(
std::numeric_limits<
int>::radix == 2,
469 "Qt assumes binary integers");
470static_assert((
std::numeric_limits<
int>::max() +
std::numeric_limits<
int>::lowest()) == -1,
471 "Qt assumes two's complement integers");
472static_assert(
sizeof(
wchar_t) ==
sizeof(
char32_t) ||
sizeof(
wchar_t) ==
sizeof(
char16_t),
473 "Qt assumes wchar_t is compatible with either char32_t or char16_t");
482#if !defined(Q_CC_GHS)
483static_assert(
std::numeric_limits<
float>::is_iec559,
484 "Qt assumes IEEE 754 floating point");
489static_assert(
std::numeric_limits<
float>::has_infinity &&
490 std::numeric_limits<
float>::has_quiet_NaN,
491 "Qt assumes IEEE 754 floating point");
497static_assert(
std::numeric_limits<
float>::radix == 2,
498 "Qt assumes binary IEEE 754 floating point");
501static_assert(
sizeof(size_t) ==
sizeof(
void *),
"size_t and a pointer don't have the same size");
502static_assert(
sizeof(size_t) ==
sizeof(qsizetype));
503static_assert((std::is_same<qsizetype, qptrdiff>::value));
504static_assert(std::is_same_v<std::size_t, size_t>);
506#if defined(QT_COMPILER_SUPPORTS_INT128) && !defined(QT_NO_INT128)
507# ifndef QT_SUPPORTS_INT128
508# error Qt needs to be compiled in a mode that enables INT128
509 if the compiler supports it in principle and QT_NO_INT128 is not defined.
514static_assert(
sizeof(
qint8) == 1,
"Internal error, qint8 is misdefined");
515static_assert(
sizeof(
qint16)== 2,
"Internal error, qint16 is misdefined");
516static_assert(
sizeof(
qint32) == 4,
"Internal error, qint32 is misdefined");
517static_assert(
sizeof(
qint64) == 8,
"Internal error, qint64 is misdefined");
518#ifdef QT_SUPPORTS_INT128
519static_assert(
sizeof(qint128) == 16,
"Internal error, qint128 is misdefined");
522#ifdef QT_SUPPORTS_INT128
530# if defined(_LIBCPP_VERSION) || (defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 11
)
531static_assert(std::numeric_limits<quint128>::max() == Q_UINT128_MAX);
QT_BEGIN_NAMESPACE typedef signed char qint8