CFx SDK Documentation
2026 SP0
Loading...
Searching...
No Matches
SDK
CFx
dd_inc
OdPlatformSettings.h
Go to the documentation of this file.
1
2
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
3
// All rights reserved.
4
//
5
// This software and its documentation and related materials are owned by
6
// the Alliance. The software may only be incorporated into application
7
// programs owned by members of the Alliance, subject to a signed
8
// Membership Agreement and Supplemental Software License Agreement with the
9
// Alliance. The structure and organization of this software are the valuable
10
// trade secrets of the Alliance and its suppliers. The software is also
11
// protected by copyright law and international treaty provisions. Application
12
// programs incorporating this software must include the following statement
13
// with their copyright notices:
14
//
15
// This application incorporates Open Design Alliance software pursuant to a license
16
// agreement with Open Design Alliance.
17
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
18
// All rights reserved.
19
//
20
// By use of this software, its documentation or related materials, you
21
// acknowledge and accept the above terms.
23
24
25
26
27
#ifndef _OD_PLATFORM_SETTINGS_H_
28
#define _OD_PLATFORM_SETTINGS_H_
29
30
31
#include <stddef.h>
32
#include <stdlib.h>
33
#include <limits.h>
34
35
#define TD_UNICODE
36
37
#if defined(__GNUC__) && !defined(GCC_VERSION)
38
#define GCC_VERSION __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__
39
#endif
40
41
#if defined(_MSC_VER)
42
#pragma warning ( disable : 4103 )
//alignment changed after including header (issued for TD_PackPush.h, TD_PackPop.h)
43
44
#if _MSC_VER >= 1900
45
// support both rvalue ref and default/delete funcs
46
#define OD_ADD_MOVE_CTOR_HAVE_DEF_DEL_FUNC
47
#endif
48
49
#define ODRX_ABSTRACT __declspec(novtable)
50
#else
51
#define ODRX_ABSTRACT
52
#endif
// _MSC_VER
53
55
#define ODRX_OVERRIDE override
57
#define ODRX_FINAL final
59
#define ODRX_SEALED final
61
#define ODRX_SEALED_VIRTUAL virtual
63
#define ODRX_OVERRIDE_DESTRUCTOR override
64
65
#if defined(_MSC_VER) && (_MSC_VER < 1900)
66
#define ODRX_NOEXCEPT
67
#define ODRX_CONSTEXPR
68
#else
69
#define ODRX_NOEXCEPT noexcept
70
#define ODRX_CONSTEXPR constexpr
71
#endif
72
73
#define TD_FUNC __FUNCTION__
74
75
#ifdef _MSC_VER
76
77
#define ODA_WINDOWS
78
#define OD_USE_WMAIN
79
//#define TD_USING(a)
80
81
#define OD_TYPENAME typename
82
#define ODA_NEED_TEMP_USING
83
#define OD_STD_ALLOCATOR_AS_IS
84
85
#if _MSC_VER <= 1900
86
#pragma warning ( disable : 4996 )
87
#endif
88
#ifndef _CRT_SECURE_NO_DEPRECATE
89
#define _CRT_SECURE_NO_DEPRECATE
90
#endif
91
92
#if defined(_IA64_)
93
#define TD_STRICT_ALIGNMENT
94
#endif
95
96
#if defined(_WIN32_WCE)
97
98
#define OD_TYPENAME typename
99
#define OD_STRING_FNS
100
#define OD_NO_GETENV
101
102
#ifdef ARM
103
#define TD_STRICT_ALIGNMENT
104
#endif
// ARM
105
106
#define OD_USE_STD_LIST
107
#define OD_HAVE_PATHFILEEXISTS_FUNC
108
#define OD_HAVE_GETFILEATTRIBUTES_FUNC
109
#define OD_HAVE_SHLWAPI_FILE
110
#define OD_HAVE_MEM_H_FILE
111
112
#define OD_NONEED_ALLOC_REDEFINITION
113
#define _IOFBF 0x0000
114
#endif
// _WIN32_WCE
115
116
#if defined(_WINRT)
117
#define OD_NO_GETENV
118
#ifdef ARM
119
#define TD_STRICT_ALIGNMENT
120
#endif
//ARM
121
#define OD_HAVE_WINDOWS_STORAGE_FILE
122
#define OD_HAVE_WRL_FILE
123
#define OD_BUILD_EXE_AS_LIBRARY
124
#define OD_NEED_S_ISDIR_FUNC
125
126
#define GetDateFormat(lpLocaleName, dwFlags, lpDate, lpFormat, lpDateStr, cchDate) GetDateFormatEx(lpLocaleName, dwFlags, lpDate, lpFormat, lpDateStr, cchDate, NULL)
127
#define GetTimeFormat(Locale, dwFlags, lpTime, lpFormat, lpTimeStr, cchTime) GetTimeFormatEx(Locale, dwFlags, lpTime, lpFormat, lpTimeStr, cchTime)
128
129
#define access _access
130
#define R_OK 04
131
#define W_OK 02
132
#endif
// _WINRT
133
134
135
#ifndef _WIN32_WCE
136
// Available functoinality
137
#define OD_HAVE_WSTAT_FUNC
138
#define OD_HAVE_SETLOCALE_FUNC
139
#define OD_HAVE_PRINT_FUNC
140
#define OD_HAVE_REMOVE_FUNC
141
// Available header files
142
#define OD_HAVE_WINSPOOL_FILE
143
#define OD_HAVE_FSTREAM_FILE
144
#define OD_HAVE_SSTREAM_FILE
145
#define OD_HAVE_IO_FILE
146
#define OD_HAVE_SYS_STAT_FILE
147
#define OD_HAVE_SYS_TYPES_FILE
148
#define OD_HAVE_IOMANIP_FILE
149
#define OD_HAVE_ERROR_FILE
150
#define OD_HAVE_TIME_FILE
151
152
#define ODA_USE_FTIME
153
// Use extended functionality
154
#define OD_USE_EXTENDED_FUNCTIONS
155
#endif
//_WIN32_WCE
156
157
#ifndef _WINRT
158
#define OD_HAVE_FINDFIRSTFILE_FUNC
159
#define OD_HAVE_MATH_FILE
160
#define OD_HAVE_OLE_ITEM_HANDLER_MODULE
161
#define OD_HAVE_GET_LOCALE_INFO
162
163
#ifndef RC_INVOKED
// prevent RC4011 warning
164
#define OD_HAS_OPENGL
165
#define OD_HAS_GDI
166
#define OD_HAS_GLES2
167
#endif
// !RC_INVOKED
168
#endif
// _WINRT
169
170
#if !defined(_WIN32_WCE) && !defined(_WINRT)
171
#define OD_HAVE_GETSTDHANDLE_FUNC
172
#define OD_WINDOWS_DESKTOP
173
#define OD_HAS_DIRECTX
174
#define OD_HAS_SYSTEM_FUNC
175
#endif
176
177
#define OD_HAVE_WINDOWS_FILE
178
#define OD_HAVE_DIRECT_FILE
179
#define OD_LOGB _logb
180
#define ODA_SECURITY_FUNC_ENABLED
181
182
#define OD_DISABLE_WARNING(warningNumber) __pragma(warning( disable : warningNumber ))
183
#define OD_DISABLE_WARNING_PUSH __pragma(warning( push ))
184
#define OD_DISABLE_WARNING_POP __pragma(warning( pop ))
185
#define OD_MSVC_DISABLE_WARNING_DECLARATION_HIDES_GLOBAL_DECLARATION OD_DISABLE_WARNING(4459)
186
#define OD_MSVC_DISABLE_WARNING_DECLARATION_HIDES_LOCAL_DECLARATION OD_DISABLE_WARNING(4456)
187
#define OD_MSVC_DISABLE_WARNING_UNREACHABLE_CODE OD_DISABLE_WARNING(4702)
188
189
#elif defined(__sun)
190
191
#define TD_STRICT_ALIGNMENT
192
#define OD_STRING_FNS
193
#define OD_STD_ALLOCATOR
194
#define ODA_UNIXOS
195
196
#ifndef __GNUC__
197
#undef TD_FUNC
198
#define TD_FUNC OD_T("")
199
#else
200
#ifdef CS
201
#undef CS
202
#endif
203
#define OD_USE_STD_LIST
204
#define OD_STD_ALLOCATOR_AS_IS
205
#endif
206
207
#define OD_TYPENAME typename
208
209
#ifndef __GNUC__
210
#define OD_TYPENAME2 typename
211
#define OD_LINKEDARRAY_SCOPE OdLinkedArray<T, A>::
212
#define OD_HAVE_SPECIFIC_DISTANCE_FUNC
213
#endif
214
215
#if defined(sparc)
216
#define ODA_BIGENDIAN
217
#endif
218
219
#if defined(__GNUC__)
220
#define TD_USING(a) using a
221
#define ODA_NEED_TEMP_USING
222
#define OD_SUN_GCC
223
#endif
224
225
// Available header files
226
#define OD_HAVE_SYS_STAT_FILE
227
#define OD_HAVE_SYS_TYPES_FILE
228
#define OD_HAVE_IOMANIP_FILE
229
#define OD_HAVE_ERROR_FILE
230
#define OD_HAVE_TIME_FILE
231
#define OD_HAVE_UNISTD_FILE
232
#define OD_HAVE_SYS_TIME_FILE
233
#define OD_HAVE_CLOCALE_FILE
234
#define OD_HAVE_FUNCTIONAL_FILE
235
#define OD_HAVE_STDIO_FILE
236
#define OD_HAVE_DIRENT_FILE
237
#define OD_HAVE_RESOURCE_FILE
238
// Available finctionality
239
#define OD_HAVE_SETLOCALE_FUNC
240
#define OD_HAVE_PRINT_FUNC
241
#define OD_HAVE_REMOVE_FUNC
242
#define OD_HAS_SYSTEM_FUNC
243
244
#define ODA_USE_FTIME
245
#define ODA_SECURITY_FUNC_ENABLED
246
247
#elif defined(ANDROID)
248
249
#if defined(__arm__)
250
#define TD_STRICT_ALIGNMENT
251
#endif
// ARM
252
#define OD_STRING_FNS
253
#define OD_TYPENAME typename
254
#define ODA_UNIXOS
255
#define ODA_NEED_TEMP_USING
256
#define OD_STD_ALLOCATOR_AS_IS
257
#define OD_NO_TMPDIR
258
#define OD_CONVERT_UNICODETOUTF8
259
260
// Available header files
261
#define OD_HAVE_SYS_STAT_FILE
262
#define OD_HAVE_SYS_TYPES_FILE
263
#define OD_HAVE_UNISTD_FILE
264
#define OD_HAVE_SYS_TIME_FILE
265
#define OD_HAVE_STDIO_FILE
266
#define OD_HAVE_DIRENT_FILE
267
#define OD_HAVE_RESOURCE_FILE
268
#define OD_HAVE_MATH_FILE
269
// Available finctionality
270
#define OD_HAVE_SETLOCALE_FUNC
271
#define OD_HAVE_PRINT_FUNC
272
#define OD_HAVE_REMOVE_FUNC
273
274
#define OD_HAS_OPENGL
275
#define OD_HAS_GLES2
276
277
//#define OD_BUILD_EXE_AS_LIBRARY
278
#define ODA_USE_FTIME
279
#define ODA_SECURITY_FUNC_ENABLED
280
281
#define OD_DO_PRAGMA(X) _Pragma(#X)
282
#define OD_DISABLE_WARNING_PUSH OD_DO_PRAGMA(clang diagnostic push)
283
#define OD_DISABLE_WARNING_POP OD_DO_PRAGMA(clang diagnostic pop)
284
#define OD_DISABLE_WARNING(warningName) OD_DO_PRAGMA(clang diagnostic ignored #warningName)
285
286
#define OD_DISABLE_CLANG_WARNING_INVALID_SOURCE_ENCODING OD_DISABLE_WARNING(-Winvalid-source-encoding)
287
#define OD_DISABLE_WARNING_VARARGS OD_DISABLE_WARNING(-Wvarargs)
288
289
#elif defined(__APPLE__) && defined(__GNUC__)
290
291
#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
// iOS devices require aligned doubles
292
#define TD_STRICT_ALIGNMENT
293
#define OD_BUILD_EXE_AS_LIBRARY
294
#endif
295
296
#ifdef MACOS_ARM
297
#define TD_STRICT_ALIGNMENT
298
#endif
299
300
#define OD_STRING_FNS
301
302
#if defined(__BIG_ENDIAN__) || !defined(__LITTLE_ENDIAN__)
303
#define ODA_BIGENDIAN
304
#endif
305
#define OD_TYPENAME typename
306
#define ODA_UNIXOS
307
#define ODA_NEED_TEMP_USING
308
#define OD_STD_ALLOCATOR_AS_IS
309
#define OD_CONVERT_UNICODETOUTF8
310
311
#define ODA_COLLECT_TTF_FONTS_IN_DRAWING_FOLDER
312
#define ODA_LINKED_WITH_FRAMEWORK_FONDATION
313
// Available functionality
314
#define OD_HAVE_UUID_FUNC
315
#define OD_HAVE_SETLOCALE_FUNC
316
#define OD_NEED_ADDITIONAL_OUTPUT
317
#define OD_HAVE_PRINT_FUNC
318
#define OD_HAVE_REMOVE_FUNC
319
#define OD_HAVE_GLOB_FUNC
320
// Available header files
321
#define OD_HAVE_SYS_STAT_FILE
322
#define OD_HAVE_SYS_TYPES_FILE
323
#define OD_HAVE_UUID_UUID_FILE
324
#define OD_HAVE_DLFCN_FILE
325
#define OD_HAVE_IOMANIP_FILE
326
#define OD_HAVE_ERROR_FILE
327
#define OD_HAVE_TIME_FILE
328
#define OD_HAVE_UNISTD_FILE
329
#define OD_HAVE_STDIO_FILE
330
#define OD_HAVE_DIRENT_FILE
331
#define OD_HAVE_SYS_TIME_FILE
332
#define OD_HAVE_RESOURCE_FILE
333
#define OD_HAVE_MATH_FILE
334
#ifndef __IPHONE_OS_VERSION_MIN_REQUIRED
335
#define OD_HAS_SYSTEM_FUNC
336
#endif
337
338
#define OD_HAS_OPENGL
339
#define OD_HAS_GLES2
340
341
#define ODA_USE_FTIME
342
#define ODA_SECURITY_FUNC_ENABLED
343
344
#define OD_DO_PRAGMA(X) _Pragma(#X)
345
#define OD_DISABLE_WARNING_PUSH OD_DO_PRAGMA(clang diagnostic push)
346
#define OD_DISABLE_WARNING_POP OD_DO_PRAGMA(clang diagnostic pop)
347
#define OD_DISABLE_WARNING(warningName) OD_DO_PRAGMA(clang diagnostic ignored #warningName)
348
349
#define OD_DISABLE_CLANG_WARNING_INVALID_SOURCE_ENCODING OD_DISABLE_WARNING(-Winvalid-source-encoding)
350
#define OD_DISABLE_WARNING_VARARGS OD_DISABLE_WARNING(-Wvarargs)
351
352
#elif defined(sgi)
353
354
#define OD_STRING_FNS
355
#define ODA_BIGENDIAN
356
#define OD_STD_ALLOCATOR
357
#ifdef ODA_SGI_721
358
#define OD_TYPENAME
359
#else
360
#define OD_TYPENAME typename
361
#endif
362
#define ODA_UNIXOS
363
#undef TD_FUNC
364
#define TD_FUNC OD_T("")
365
366
// Available header files
367
#define OD_HAVE_SYS_STAT_FILE
368
#define OD_HAVE_SYS_TYPES_FILE
369
#define OD_HAVE_IOMANIP_FILE
370
#define OD_HAVE_ERROR_FILE
371
#define OD_HAVE_TIME_FILE
372
#define OD_HAVE_UNISTD_FILE
373
#define OD_HAVE_STDIO_FILE
374
#define OD_HAVE_DIRENT_FILE
375
#define OD_HAVE_SYS_TIME_FILE
376
#define OD_HAVE_RESOURCE_FILE
377
// Available finctionality
378
#define OD_HAVE_SETLOCALE_FUNC
379
#define OD_HAVE_PRINT_FUNC
380
#define OD_HAVE_REMOVE_FUNC
381
382
#define OD_REDEFINE_HEAP_OPERATORS
383
#define ODA_USE_FTIME
384
#define ODA_SECURITY_FUNC_ENABLED
385
386
#elif defined(__hpux)
387
388
#define TD_STRICT_ALIGNMENT
389
#define OD_STRING_FNS
390
#define ODA_BIGENDIAN
391
#define OD_STD_ALLOCATOR
392
#define ODA_NEED_TEMP_USING
393
#define ODA_FORMAT
394
#define ODA_UNIXOS
395
396
// Requires typename keyword in some contexts, which are illegal with other compilers.
397
#define OD_TYPENAME typename
398
399
#define TD_USING(a) using a;
400
401
#define OD_REDEFINE_STD 1
402
#define OD_USING_BUGWARE 1
403
404
// Available header files
405
#define OD_HAVE_SYS_STAT_FILE
406
#define OD_HAVE_SYS_TYPES_FILE
407
#define OD_HAVE_IOMANIP_FILE
408
#define OD_HAVE_ERROR_FILE
409
#define OD_HAVE_TIME_FILE
410
#define OD_HAVE_UNISTD_FILE
411
#define OD_HAVE_SYS_TIME_FILE
412
#define OD_HAVE_FUNCTIONAL_FILE
413
#define OD_HAVE_STDIO_FILE
414
#define OD_HAVE_DIRENT_FILE
415
#define OD_HAVE_RESOURCE_FILE
416
// Available finctionality
417
#define OD_HAVE_SETLOCALE_FUNC
418
#define OD_HAVE_PRINT_FUNC
419
#define OD_HAVE_REMOVE_FUNC
420
#define OD_HAS_SYSTEM_FUNC
421
422
#define OD_REDEFINE_HEAP_OPERATORS
423
#define ODA_USE_FTIME
424
#define ODA_SECURITY_FUNC_ENABLED
425
426
#elif defined(_AIX)
427
428
#define OD_STRING_FNS
429
#define ODA_BIGENDIAN
430
#define OD_STD_ALLOCATOR_AS_IS
431
#define ODA_NEED_TEMP_USING
432
// Requires typename keyword in some contexts, which are illegal with other compilers.
433
#define OD_TYPENAME typename
434
#define OD_TYPENAME3 typename
435
#define ODA_UNIXOS
436
437
// Available header files
438
#define OD_HAVE_SYS_STAT_FILE
439
#define OD_HAVE_SYS_TYPES_FILE
440
#define OD_HAVE_IOMANIP_FILE
441
#define OD_HAVE_ERROR_FILE
442
#define OD_HAVE_TIME_FILE
443
#define OD_HAVE_UNISTD_FILE
444
#define OD_HAVE_SYS_TIME_FILE
445
#define OD_HAVE_STDIO_FILE
446
#define OD_HAVE_DIRENT_FILE
447
#define OD_HAVE_RESOURCE_FILE
448
// Available finctionality
449
#define OD_HAVE_SETLOCALE_FUNC
450
#define OD_HAVE_PRINT_FUNC
451
#define OD_HAVE_REMOVE_FUNC
452
#define OD_HAS_SYSTEM_FUNC
453
454
#define OD_REDEFINE_HEAP_OPERATORS
455
#define ODA_USE_FTIME
456
#define ODA_SECURITY_FUNC_ENABLED
457
458
#elif defined(__BCPLUSPLUS__)|| defined(__BORLANDC__)
459
#define ODA_WINDOWS
460
#define OD_USE_WMAIN
461
#undef TD_FUNC
462
#define TD_FUNC __FUNC__
463
464
#define OD_STD_ALLOCATOR_AS_IS
465
#define ODA_GCC_2_95
466
#define OD_BSEARCH std::bsearch
467
#define OD_LOGB _logb
468
469
// Available finctionality
470
#define OD_HAVE_WSTAT_FUNC
471
#define OD_HAVE_FINDFIRSTFILE_FUNC
472
#define OD_HAVE_SETLOCALE_FUNC
473
#define OD_HAVE_GET_LOCALE_INFO
474
#define OD_HAVE_PRINT_FUNC
475
#define OD_HAVE_REMOVE_FUNC
476
477
// Available header files
478
#define OD_HAVE_IO_FILE
479
#define OD_HAVE_SYS_STAT_FILE
480
#define OD_HAVE_SYS_TYPES_FILE
481
#define OD_HAVE_IOMANIP_FILE
482
#define OD_HAVE_ERROR_FILE
483
#define OD_HAVE_TIME_FILE
484
#define OD_HAVE_WINDOWS_FILE
485
486
#define OD_HAVE_GETSTDHANDLE_FUNC
487
#define OD_WINDOWS_DESKTOP
488
#define OD_HAS_SYSTEM_FUNC
489
490
#define OD_HAVE_OLE_ITEM_HANDLER_MODULE
491
492
#define OD_HAS_OPENGL
493
#define OD_HAS_GDI
494
#define OD_HAS_GLES2
495
496
#define ODA_USE_FTIME
497
#define ODA_SECURITY_FUNC_ENABLED
498
499
#elif defined(__GNUC__) && defined(_WIN32)
500
#define ODA_WINDOWS
501
#define ODA_WINDOWS_GCC
502
#define OD_WINDOWS_DESKTOP
503
#define OD_POSIX_THREADS
504
505
#define OD_TYPENAME typename
506
#define OD_STD_ALLOCATOR_AS_IS
507
508
#define OD_LOGB ilogb
509
#define ODA_NEED_TEMP_USING
510
511
#define OD_HAVE_RPC_H_FILE
512
#define OD_HAVE_WINBASE_H_FILE
513
514
// Available header files/functionality
515
#define OD_HAVE_IO_FILE
516
#define OD_HAVE_SYS_STAT_FILE
517
#define OD_HAVE_SYS_TYPES_FILE
518
#define OD_HAVE_IOMANIP_FILE
519
#define OD_HAVE_ERROR_FILE
520
#define OD_HAVE_TIME_FILE
521
#define OD_HAVE_UNISTD_FILE
522
#define OD_HAVE_SYS_TIME_FILE
523
#define OD_HAVE_STDIO_FILE
524
// Available finctionality
525
#define OD_HAVE_SETLOCALE_FUNC
526
#define OD_HAVE_PRINT_FUNC
527
#define OD_HAVE_REMOVE_FUNC
528
#define OD_HAS_SYSTEM_FUNC
529
#define OD_HAVE_GLOB_FUNC
530
531
#define OD_HAS_OPENGL
532
#define OD_HAS_GLES2
533
534
#define ODA_USE_FTIME
535
#define ODA_SECURITY_FUNC_ENABLED
536
537
// Available functoinality
538
#define OD_HAVE_WSTAT_FUNC
539
// Available header files
540
#define OD_HAVE_WINSPOOL_FILE
541
#define OD_HAVE_FSTREAM_FILE
542
#define OD_HAVE_SSTREAM_FILE
543
544
#elif defined(__linux__)|| defined(__FreeBSD__) || defined(__MVS__)
545
546
#if __cplusplus >= 201103L
547
#define OD_ADD_MOVE_CTOR_HAVE_DEF_DEL_FUNC
548
#endif
549
550
#if (__cplusplus < 201103L)
551
#define NO_SHARED_PTR
552
#define unique_ptr auto_ptr
553
#define nullptr 0
554
#endif
555
556
#define OD_STRING_FNS
557
#define OD_TYPENAME typename
558
#define ODA_UNIXOS
559
#define ODA_NEED_TEMP_USING
560
#define OD_STD_ALLOCATOR_AS_IS
561
#define OD_CONVERT_UNICODETOUTF8
562
#define ODA_COLLECT_TTF_FONTS_IN_DRAWING_FOLDER
563
// Linux ppc requires big endian byte ordering
564
#if defined(__BIG_ENDIAN__) || defined(__s390__)
565
#define ODA_BIGENDIAN
566
#endif
567
#if defined(ARM) || defined(EMCC)
568
#define TD_STRICT_ALIGNMENT
569
#endif
570
571
// Available header files
572
#define OD_HAVE_SYS_STAT_FILE
573
#define OD_HAVE_SYS_TYPES_FILE
574
#define OD_HAVE_IOMANIP_FILE
575
#define OD_HAVE_ERROR_FILE
576
#define OD_HAVE_TIME_FILE
577
#define OD_HAVE_UNISTD_FILE
578
#define OD_HAVE_SYS_TIME_FILE
579
#define OD_HAVE_DIRENT_FILE
580
#define OD_HAVE_STDIO_FILE
581
#define OD_HAVE_RESOURCE_FILE
582
// Available functionality
583
#define OD_HAVE_SETLOCALE_FUNC
584
#define OD_HAVE_PRINT_FUNC
585
#define OD_HAVE_REMOVE_FUNC
586
#define OD_HAS_SYSTEM_FUNC
587
#define OD_HAVE_GLOB_FUNC
588
#define OD_HAS_OPENGL
589
#define OD_HAS_GLES2
590
591
#define ODA_USE_FTIME
592
#define ODA_SECURITY_FUNC_ENABLED
593
594
#elif defined(__CYGWIN32__) || defined(__MINGW32__)
595
596
#define ODA_UNIXOS
597
#define OD_TYPENAME typename
598
#define OD_LOGB ilogb
599
#define OD_STRING_FNS
600
#define ODA_NEED_TEMP_USING
601
// Available header files/functionality
602
#define OD_HAVE_IO_FILE
603
#define OD_HAVE_SYS_STAT_FILE
604
#define OD_HAVE_SYS_TYPES_FILE
605
#define OD_HAVE_IOMANIP_FILE
606
#define OD_HAVE_ERROR_FILE
607
#define OD_HAVE_TIME_FILE
608
#define OD_HAVE_UNISTD_FILE
609
#define OD_HAVE_SYS_TIME_FILE
610
#define OD_HAVE_STDIO_FILE
611
// Available finctionality
612
#define OD_HAVE_SETLOCALE_FUNC
613
#define OD_HAVE_PRINT_FUNC
614
#define OD_HAVE_REMOVE_FUNC
615
#define OD_HAS_SYSTEM_FUNC
616
617
#define OD_HAS_OPENGL
618
#define OD_HAS_GLES2
619
620
#define ODA_USE_FTIME
621
#define ODA_SECURITY_FUNC_ENABLED
622
623
#elif defined(EMCC)
624
625
#define ODA_UNIXOS
626
#define OD_TYPENAME typename
627
#define OD_LOGB ilogb
628
#define OD_STRING_FNS
629
#define ODA_NEED_TEMP_USING
630
#define OD_STD_ALLOCATOR_AS_IS
631
#define TD_STRICT_ALIGNMENT
632
#define OD_CONVERT_UNICODETOUTF8
633
#define ODA_COLLECT_TTF_FONTS_IN_DRAWING_FOLDER
634
// Available header files
635
#define OD_HAVE_SYS_STAT_FILE
636
#define OD_HAVE_SYS_TYPES_FILE
637
#define OD_HAVE_IOMANIP_FILE
638
#define OD_HAVE_ERROR_FILE
639
#define OD_HAVE_TIME_FILE
640
#define OD_HAVE_UNISTD_FILE
641
#define OD_HAVE_SYS_TIME_FILE
642
#define OD_HAVE_DIRENT_FILE
643
#define OD_HAVE_STDIO_FILE
644
#define OD_HAVE_RESOURCE_FILE
645
// Available finctionality
646
#define OD_HAVE_SETLOCALE_FUNC
647
#define OD_HAVE_PRINT_FUNC
648
#define OD_HAVE_REMOVE_FUNC
649
#define OD_HAS_SYSTEM_FUNC
650
651
#define OD_HAS_OPENGL
652
#define OD_HAS_GLES2
653
654
#define ODA_USE_FTIME
655
#define ODA_SECURITY_FUNC_ENABLED
656
657
#else
658
659
#error "Unsupported Platform/Compiler"
660
#endif
661
662
#ifndef OD_LOGB
663
#define OD_LOGB logb
664
#endif
665
666
#if !defined(ODA_WINDOWS)
667
// @@@TODO: check for this platforms
668
#if (!defined(__sun) && !defined(__hpux) && !defined(sgi))
669
#define OD_POSIX_THREADS
670
#endif
671
#define OD_HAVE_COMPLEX_FILE
672
#endif
673
674
#if defined(TARGET_OS_MAC) && !defined(__MACH__)
675
#define OD_HAVE_CONSOLE_H_FILE
676
#define OD_HAVE_CCOMMAND_FUNC
677
#endif
678
679
#if defined(__APPLE__) || (defined(__GLIBC__) && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 10)))
680
#define OD_HAVE_MKSTEMPS_FUNC
681
#endif
682
#define OD_T(x) ( (const OdChar*)__OD_T(x))
683
#ifdef ODA_WINDOWS_GCC
684
#define __OD_T(x) L##x
685
#else
686
#define __OD_T(x) L ## x
687
#endif
688
689
#if defined(ODA_WINDOWS) && !defined(ODA_WINDOWS_GCC)
690
#if _MSC_VER >= 1900
691
#define OD_CONCAT(a, b) __OD_T(a) __OD_T(b)
692
#else
693
#define OD_CONCAT(a, b) __OD_T(a) ## __OD_T(b)
694
#endif
695
#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 1408)
696
#define DDLL(a) a##ULL
697
#else
698
#define DDLL(a) a
699
#endif
700
#else
701
#if defined(__sun) || defined(sgi) || defined(__hpux) || defined(_AIX)
702
#define OD_CONCAT(a, b) L##a L##b
703
#else
704
#define OD_CONCAT(a, b) L##a b
705
#endif
706
#define DDLL(a) a##ULL
707
#endif
708
709
#ifndef SWIG
710
#if defined(_NATIVE_WCHAR_T_DEFINED)
711
typedef
unsigned
short
OdChar
;
712
typedef
unsigned
short
OdUChar
;
713
#else
714
typedef
wchar_t
OdChar
;
715
typedef
wchar_t
OdUChar
;
716
#endif
717
#endif
718
719
#ifndef __APPLE__
720
#if !(defined(_MSC_VER) && _MSC_VER <= 1800)
721
#include <uchar.h>
722
#endif
723
#else
724
#include <stdint.h>
725
#endif
726
#if defined(ODA_WINDOWS)
727
typedef
wchar_t
OdChar16_t
;
728
#elif __APPLE__
729
typedef
__CHAR16_TYPE__
OdChar16_t
;
730
#else
731
typedef
char16_t
OdChar16_t
;
732
#endif
733
734
#if defined(ODA_WINDOWS)
735
#define ODCHAR_IS_INT16LE 1
736
#else
737
#define ODCHAR_IS_INT16LE 0
738
#endif
739
740
typedef
signed
char
OdInt8
;
741
typedef
short
OdInt16
;
742
typedef
int
OdInt
;
743
744
typedef
unsigned
char
OdUInt8
;
745
typedef
unsigned
short
OdUInt16
;
746
747
#if UINT_MAX == 0xFFFFFFFFUL
748
#define OD_SIZEOF_INT 4
749
#elif UINT_MAX > 0xFFFFFFFFU && UINT_MAX == 0xFFFFFFFFFFFFFFFFU
750
#error "8 byte size of `int' type unsupported!"
751
#else
752
#error "Unsupported number of *bytes* in `int' type!"
753
#endif
754
755
#if ULONG_MAX == 0xFFFFFFFFUL
756
#define OD_SIZEOF_LONG 4
757
#elif (ULONG_MAX > 0xFFFFFFFFU && ULONG_MAX == 0xFFFFFFFFFFFFFFFFU) || (defined(sparc) && defined(_LP64))
758
#define OD_SIZEOF_LONG 8
759
#else
760
#error "Unsupported number of *bytes* in `long' type!"
761
#endif
762
763
#if OD_SIZEOF_LONG == 4
764
typedef
long
OdInt32
;
765
typedef
unsigned
long
OdUInt32
;
766
#else
// assumes 4-byte int type
767
typedef
int
OdInt32
;
768
typedef
unsigned
int
OdUInt32
;
769
#endif
770
771
#if defined(_IA64_) || defined(ODA_WINDOWS)
772
#define BUILTIN_INT64 __int64
773
#define OD_ATOI64 _atoi64
774
#define PERCENT18LONG "%18I64d\r\n"
775
#define HANDLEFORMAT "%I64X\r\n"
776
777
#elif OD_SIZEOF_LONG == 8
778
#define BUILTIN_INT64 long
779
#define OD_ATOI64 atol
780
#define PERCENT18LONG "%18ld\r\n"
781
#define HANDLEFORMAT "%lX\r\n"
782
783
#elif defined(ODA_UNIXOS)
784
#define BUILTIN_INT64 long long
785
#define OD_ATOI64 atoll
786
#if (defined(__hpux) && !defined(atoll) && defined(__cplusplus)) || defined(_AIX_SOURCE)
787
inline
long
long
atoll(
const
char
*instr)
788
{
789
long
long
retval;
790
int
i;
791
792
retval = 0;
793
for
(; *instr; instr++) {
794
retval = 10*retval + (*instr -
'0'
);
795
}
796
return
retval;
797
}
798
#endif
799
#define PERCENT18LONG "%18lld\r\n"
800
#define HANDLEFORMAT "%llX\r\n"
801
#endif
802
803
#ifdef BUILTIN_INT64
804
typedef
BUILTIN_INT64
OdInt64
;
805
typedef
unsigned
BUILTIN_INT64
OdUInt64
;
806
#else
807
#include "
Int64.h
"
808
#define OD_ATOI64 atoi
// TODO
809
#error ("sprinf can't process this without built-in in64 type")
810
#define PERCENT18LONG "%18d\r\n"
// TODO
811
#define HANDLEFORMAT "%X\r\n"
812
#endif
813
814
// C99 definitions for int64 portable printf format
815
#if !defined(__BORLANDC__) && (!defined(_MSC_VER) || _MSC_VER >= 1800)
816
#include <inttypes.h>
817
#endif
818
#ifndef PRId64W
819
#define PRId64W L"lld"
820
#endif
821
#ifndef PRIu64W
822
#define PRIu64W L"llu"
823
#endif
824
#ifndef PRIx64W
825
#define PRIx64W L"llx"
826
#endif
827
#ifndef PRIX64W
828
#define PRIX64W L"llX"
829
#endif
830
#ifndef PRId64
831
#define PRId64 "lld"
832
#endif
833
#ifndef PRIu64
834
#define PRIu64 "llu"
835
#endif
836
#ifndef PRIx64
837
#define PRIx64 "llx"
838
#endif
839
#ifndef PRIX64
840
#define PRIX64 "llX"
841
#endif
842
843
844
typedef
void
*
VoidPtr
;
845
#ifdef EMCC
846
typedef
int
OdIntPtr
;
847
#else
848
typedef
ptrdiff_t
OdIntPtr
;
// Integer able to store a pointer (32 or 64 depending on platform)
849
#endif
850
851
852
#if (OD_SIZEOF_LONG == 4) && !defined(_WIN64) && !defined(__hpux) && !defined(_AIX)
853
#define OD_INTPTR_UNIQUE
854
#endif
855
856
typedef
ptrdiff_t
OdGsMarker
;
// Integer able to store a pointer (32 or 64 depending on platform)
857
858
typedef
ptrdiff_t
OdHWnd
;
859
860
861
#if defined (_WIN64)
862
#define OD_SIZEOF_PTR 8
863
#else
864
// This may need to be adjusted
865
#define OD_SIZEOF_PTR OD_SIZEOF_LONG
866
#endif
867
868
#define OdIntToPtr(arg) ((void*)((ptrdiff_t)(arg)))
869
870
#define OdPtrToInt32(arg) ((OdInt32)((ptrdiff_t)(arg)))
871
872
#define OdIntToGsMarker(arg) ((OdGsMarker)((ptrdiff_t)(arg)))
873
875
// Non-MSVC dynamic library loading.
876
877
#ifdef _TOOLKIT_IN_DLL_
878
879
#if defined(ODA_WINDOWS)
880
881
// 4251: class 'type1' needs to have dll-interface to be used by clients of class 'type2'
882
// 4275: non - DLL-interface class 'class_1' used as base for DLL-interface class 'class_2'
883
#pragma warning( disable: 4275 4251 )
884
#define OD_DLL_EXPORT __declspec(dllexport)
885
#define OD_DLL_IMPORT __declspec(dllimport)
886
887
#elif defined(ODA_UNIXOS)
// GNU compiler MacOS X (xCode), unix, linex and others
888
889
#define OD_DLL_EXPORT __attribute__((visibility("default")))
890
#define OD_DLL_IMPORT __attribute__((visibility("default")))
891
892
#endif
893
894
#define OD_EXTERN extern
895
896
#if defined(_MSC_VER)
897
#define OD_TOOLKIT_EXPORT OD_DLL_EXPORT
898
#define OD_STATIC_EXPORT
899
#define OD_TOOLKIT_IMPORT
900
#define OD_STATIC_IMPORT OD_DLL_IMPORT
901
#elif defined(__BORLANDC__)
902
#define OD_TOOLKIT_EXPORT OD_DLL_EXPORT
903
#define OD_STATIC_EXPORT
904
#define OD_TOOLKIT_IMPORT OD_DLL_IMPORT
905
#define OD_STATIC_IMPORT
906
#else
907
#define OD_TOOLKIT_EXPORT OD_DLL_EXPORT
908
#define OD_STATIC_EXPORT
909
#define OD_TOOLKIT_IMPORT
910
#define OD_STATIC_IMPORT OD_DLL_IMPORT
911
#endif
912
913
#else
// of _TOOLKIT_IN_DLL_
914
915
#define OD_TOOLKIT_EXPORT
916
#define OD_STATIC_EXPORT
917
#define OD_TOOLKIT_IMPORT
918
#define OD_STATIC_IMPORT
919
920
#define OD_DLL_EXPORT
921
#define OD_DLL_IMPORT
922
#define OD_EXTERN
923
924
#endif
// of _TOOLKIT_IN_DLL_
926
927
// In case warnings macros are not defined
928
#ifndef OD_DISABLE_WARNING_PUSH
929
#define OD_DISABLE_WARNING_PUSH
930
#endif
931
932
#ifndef OD_DISABLE_WARNING_POP
933
#define OD_DISABLE_WARNING_POP
934
#endif
935
936
#ifndef OD_DISABLE_WARNING
937
#define OD_DISABLE_WARNING
938
#endif
939
940
#ifndef OD_DISABLE_CLANG_WARNING_INVALID_SOURCE_ENCODING
941
#define OD_DISABLE_CLANG_WARNING_INVALID_SOURCE_ENCODING
942
#endif
943
944
#ifndef OD_DISABLE_WARNING_VARARGS
945
#define OD_DISABLE_WARNING_VARARGS
946
#endif
947
948
#ifndef OD_MSVC_DISABLE_WARNING_DECLARATION_HIDES_GLOBAL_DECLARATION
949
#define OD_MSVC_DISABLE_WARNING_DECLARATION_HIDES_GLOBAL_DECLARATION
950
#endif
951
952
#ifndef OD_MSVC_DISABLE_WARNING_DECLARATION_HIDES_LOCAL_DECLARATION
953
#define OD_MSVC_DISABLE_WARNING_DECLARATION_HIDES_LOCAL_DECLARATION
954
#endif
955
956
#ifndef OD_MSVC_DISABLE_WARNING_UNREACHABLE_CODE
957
#define OD_MSVC_DISABLE_WARNING_UNREACHABLE_CODE
958
#endif
959
#if (defined(__GNUC__ ) && !defined(__FreeBSD__) ) || (defined(_SOLX64))
960
#define TD_USE_VA_COPY
961
#endif
962
963
#if (defined EMCC && !defined(OD_TYPENAME))
964
#define OD_TYPENAME typename
965
#endif
966
967
#endif
//#ifndef _OD_PLATFORM_SETTINGS_H_
968
Int64.h
OdGsMarker
ptrdiff_t OdGsMarker
Definition
OdPlatformSettings.h:856
OdHWnd
ptrdiff_t OdHWnd
Definition
OdPlatformSettings.h:858
OdUInt32
unsigned int OdUInt32
Definition
OdPlatformSettings.h:768
OdInt16
short OdInt16
Definition
OdPlatformSettings.h:741
OdInt8
signed char OdInt8
Definition
OdPlatformSettings.h:740
OdUInt16
unsigned short OdUInt16
Definition
OdPlatformSettings.h:745
VoidPtr
void * VoidPtr
Definition
OdPlatformSettings.h:844
OdInt
int OdInt
Definition
OdPlatformSettings.h:742
OdInt32
int OdInt32
Definition
OdPlatformSettings.h:767
OdUInt8
unsigned char OdUInt8
Definition
OdPlatformSettings.h:744
OdChar16_t
char16_t OdChar16_t
Definition
OdPlatformSettings.h:731
OdUChar
wchar_t OdUChar
Definition
OdPlatformSettings.h:715
OdIntPtr
ptrdiff_t OdIntPtr
Definition
OdPlatformSettings.h:848
OdChar
wchar_t OdChar
Definition
OdPlatformSettings.h:714
OdInt64
Definition
Int64.h:43
OdUInt64
Definition
Int64.h:137
Generated on Tue Apr 15 2025 11:30:04