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