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