CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
OdPlatform.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_H_
28#define _OD_PLATFORM_H_
29
30
31#include "OdPlatformSettings.h"
32#include "OdGUID.h"
33// Moved from OdaCommon.h, to be used in string functions
34#define odmin(X,Y) ((X) < (Y) ? (X) : (Y))
35#define odmax(X,Y) ((X) > (Y) ? (X) : (Y))
36
37
38#if defined(ODA_WINDOWS)
39#include <math.h>
40#include <float.h>
41#define Odisnan(x) (::_isnan(x) != 0)
42#define Odfinite(x) (::_finite(x) != 0)
43#ifndef OD_USE_EXTENDED_FUNCTIONS
44#define GETSS(s,n) ::fgets(s, n, stdin)
45#define OdWprintf wprintf
46#define OdPrintf printf
47#else
48#define GETSS(s,n) ::gets_s(s,n)
49#define OdWprintf _wprintf_p
50#define OdPrintf _printf_p
51#endif
52
53#ifdef ODA_WINDOWS_GCC
54#include <ctype.h>
55#endif
56
57#if defined(_MSC_VER) && (_MSC_VER < 1400)
58#ifndef GET_X_LPARAM
59#define GET_X_LPARAM(lParam) ((int)(short)LOWORD(lParam))
60#endif
61#ifndef GET_Y_LPARAM
62#define GET_Y_LPARAM(lParam) ((int)(short)HIWORD(lParam))
63#endif
64#endif
65
66#else
67#include <stdio.h>
68#include <limits.h>
69#define GETSS(s, n) fgets(s, n, stdin)
70
71#ifndef MAX_PATH
72#define MAX_PATH PATH_MAX
73#endif
74
75#define OdWprintf wprintf
76#define OdPrintf printf
77
78#if defined(__APPLE__) || defined(__GNUC__) && ( __GNUC__>=5 || __GNUC__==4 && __GNUC_MINOR__>=9 )
79#include <math.h>
80#define Odisnan(x) std::isnan(x)
81#define Odfinite(x) std::isfinite(x)
82#else
83#if defined(__sun)
84#include <ieeefp.h>
85#else
86#include <math.h>
87#endif
88#define Odisnan(x) std::isnan(x)
89#define Odfinite(x) (finite(x) != 0)
90#endif
91#endif
92
93#ifdef ANDROID
94 //r9d have disabled acosl function
95 #ifndef acosl
96 #define acosl acos
97 #endif
98#endif
99
100#ifdef _WIN32_WCE
101// Safe to avoid #ifndef/#endif here due to WinCE specific
102#define sinf sin
103#define cosf cos
104#define atanf atan
105#endif
106
107#ifdef ANDROID_WCHAR
108#include "../../ThirdParty/wchar/stdlib_.h"
109#include "../../ThirdParty/wchar/wchar_.h"
110#define Od_atof Citrus::atof
111#define Od_abs Citrus::abs
112#define Od_labs Citrus::labs
113#define Od_llabs Citrus::llabs
114#define Od_srand Citrus::srand
115#define Od_rand Citrus::rand
116#define Od_wcstombs Citrus::wcstombs
117#define Od_wcscpy Citrus::wcscpy
118#define Od_wcscmp Citrus::wcscmp
119#define Od_wcscat Citrus::wcscat
120#define Od_wcschr Citrus::wcschr
121#define Od_wcscpy Citrus::wcscpy
122#define Od_wcslen Citrus::wcslen
123#define Od_wcsncpy Citrus::wcsncpy
124#else
125
126#if defined(_MSC_VER) && (_MSC_VER < 1600)
127#include <stdlib.h>
128#else
129#include <cstdlib>
130#include <cmath>
131#endif
132
133#if defined(__BCPLUSPLUS__) || defined(__BORLANDC__) || defined(__sun)
134inline long Od_abs(OdInt64 val) { return std::labs(val); }
135inline int Od_abs(OdInt32 val) { return std::abs(val); }
136#if OD_SIZEOF_LONG == 4
137inline int Od_abs(int val) { return std::abs(val); }
138#endif
139inline double Od_abs(double val) { return std::fabs(val); }
140#else
141#define Od_abs std::abs
142#endif
143
144#define Od_atof atof
145#define Od_labs std::labs
146#define Od_llabs std::llabs
147#define Od_srand srand
148#define Od_rand rand
149#define Od_wcstombs wcstombs
150#define Od_wcscpy wcscpy
151#define Od_wcscmp wcscmp
152#define Od_wcscat wcscat
153#define Od_wcschr wcschr
154#define Od_wcslen wcslen
155#define Od_wcsncpy wcsncpy
156#endif
157
158#if defined(_MSC_VER) && (_MSC_VER < 1800)
159template<typename T>
160inline T Od_round(T a)
161{
162 T result;
163 if (a - floor(a) >= 0.5)
164 result = floor(a) + 1;
165 else
166 result = floor(a);
167 return result;
168}
169#else
170#define Od_round std::round
171#endif
172
173#ifndef odStrChr
174#define odStrChr(str, ch) strchr(str, ch)
175#endif
176
177#ifndef odWStrChr
178#define odWStrChr(str, ch) Od_wcschr(str, ch)
179#endif
180
181#ifdef OD_STRING_FNS
182
183
184FIRSTDLL_EXPORT extern int Od_stricmp(const OdChar*str, const OdChar* str2);
185FIRSTDLL_EXPORT extern int Od_strnicmp(const OdChar *s1, const OdChar *s2, int len);
186FIRSTDLL_EXPORT extern OdChar* Od_strupr(OdChar* str);
187FIRSTDLL_EXPORT extern OdChar* Od_strlwr(OdChar* str);
188FIRSTDLL_EXPORT extern OdChar* Od_strrev(OdChar* str);
189FIRSTDLL_EXPORT extern int Od_strnicmpA(const char *s1, const char *s2, int len);
190FIRSTDLL_EXPORT extern int Od_stricmpA(const char* str, const char* str2);
191FIRSTDLL_EXPORT extern char* Od_struprA(char* str);
192FIRSTDLL_EXPORT extern char* Od_strlwrA(char* str);
193FIRSTDLL_EXPORT extern char* Od_strrevA(char* str);
194
195#if !defined(_WIN32_WCE)
196#define odStrUpr(str) Od_strupr(str)
197#define odStrLwr(str) Od_strlwr(str)
198#define odStrRev(str) Od_strrev(str)
199#endif
200//FELIX_CHANGE_BEGIN
201/*
202#if !defined(__linux__) && !defined(_WIN32_WCE)
203*/
204#if !defined(__linux__) && !defined(_WIN32_WCE) || defined(ANDROID)//FELIX_CHANGE_END
205#define odStrICmp(str, str2) Od_stricmp(str, str2)
206#define odStrnICmp(str, str2, n) Od_strnicmp(str, str2, n)
207#define odStrnICmpA Od_strnicmpA
208#define odStrICmpA(str, str2) Od_stricmpA(str, str2)
209#define odStrUprA(str) Od_struprA(str)
210#define odStrLwrA(str) Od_strlwrA(str)
211#define odStrRevA(str) Od_strrevA(str)
212
213#endif // !defined(__linux__)
214
215#endif /* OD_STRING_FNS */
216
217/* strings functions */
218//FELIX_CHANGE_BEGIN
219/*
220#if defined(ANDROID_WCHAR)
221 #include <string>
222 #if !defined(OD_WSTRING_DEFINED) && (!defined(_STRINGFWD_H) || !defined(_GLIBCXX_USE_WCHAR_T))
223 #define OD_WSTRING_DEFINED
224 #include <bits/basic_string.h>
225 //#include <iosfwd>
226 namespace std
227 {
228 typedef basic_string<wchar_t> wstring;
229 typedef basic_istringstream<wchar_t> wistringstream;
230 typedef basic_stringstream<wchar_t> wstringstream;
231 }
232 #endif
233 #include "../../ThirdParty/wchar/wchar_.h" // #include <wchar_.h>
234
235 #define odStrLen(str) Citrus::wcslen(str)
236 #define odStrCmp(str, str2) Citrus::wcscmp(str, str2)
237 inline long Od_strtoint(const OdChar* str)
238 {
239 return Citrus::wcstol((const wchar_t*)str, 0, 10);
240 }
241 #define odStrToInt(str) Od_strtoint(str)
242
243 #pragma MARKMESSAGE("DNA: odStrToInt() looses highest bit of UInt32: FFFFFFFF -> 7FFFFFFF (at least on WIN64)")
244 #define odStrToUInt(str) (unsigned long)(Od_strtoint(str))
245 // TODO
246 //inline unsigned long Od_strtouint(const OdChar* str)
247 //{
248 // return Citrus::wcstoul((const wchar_t*)str, 0, 10);
249 //}
250 //#define odStrToUInt(str) Od_strtouint(str)
251
252 // #define odSScanf Citrus::swscanf
253 // #define odSprintf Citrus::swprintf
254 inline double Od_wtof(const wchar_t* str)
255 {
256 wchar_t *endptr = 0;
257 return Citrus::wcstold(str, &endptr);
258 }
259 #define odStrToF Od_wtof
260 #define odStrStr Citrus::wcsstr
261 // see OdDToStr.h and TD/Source/fltcvt/OdGdtoa.cpp for odDToStr and odStrToD
262 #define wcsicmp Citrus::wcscasecmp
263 #define wcsnicmp Citrus::wcsncasecmp
264#else
265 #include <wchar.h>
266#endif
267*/
268#include <wchar.h>
269//FELIX_CHANGE_END
270
271#ifndef odStrLen
272#define odStrLen(str) wcslen(str)
273#endif
274
275#ifndef odStrLenA
276#define odStrLenA(str) strlen(str)
277#endif
278
279#ifndef odStrCmp
280#define odStrCmp(str, str2) wcscmp(str, str2)
281#endif
282
283#ifndef odStrCmpA
284#define odStrCmpA(str, str2) strcmp(str, str2)
285#endif
286
287#if defined(ODA_WINDOWS)
288#ifndef NOMINMAX
289#define NOMINMAX
290#endif
291#endif
292
293#if defined(ODA_WINDOWS)
294#ifndef WIN32_LEAN_AND_MEAN
295#define WIN32_LEAN_AND_MEAN
296#endif
297#include <Windows.h>
298#endif
299#if defined( ANDROID ) || defined ( _WIN32_WCE ) || (defined (_MSC_VER) && _MSC_VER < 1400) || defined(_WINRT)
300 #define FSEEK fseek
301 #define FTELL ftell
302 #define FOPEN fopen
303 #define OFFSETTYPE(offset) (long)offset
304
305#elif defined(__APPLE__) || defined( __hpux )
306 #define FSEEK fseeko
307 #define FTELL ftello
308 #define FOPEN fopen
309 #define OFFSETTYPE(offset) offset
310#else
311 #define FSEEK fseeko64
312 #define FTELL ftello64
313 #define FOPEN fopen64
314 #define OFFSETTYPE(offset) offset
315#endif
316
317#if defined(__linux__) || defined(EMCC)
318#include <wctype.h> // towlower, towupper
319#if !defined(EMCC) && !defined(__clang__)
320#include <bits/stl_algobase.h> // For std::swap (gcc 3.3 and 3.4)
321#endif
322#include <utility> // std::swap
323
324#ifndef wcsicmp
325#define wcsicmp wcscasecmp
326#endif
327
328#ifndef wcsnicmp
329#define wcsnicmp wcsncasecmp
330#endif
331
332#ifndef wcsupr
333inline wchar_t* wcsupr(wchar_t* s)
334{
335 if(!s)
336 return 0;
337 for(wchar_t* p = s; *p; ++p)
338 *p = towupper(*p);
339 return s;
340}
341#endif
342
343#ifndef wcslwr
344inline wchar_t* wcslwr(wchar_t* s)
345{
346 if(!s)
347 return 0;
348 for(wchar_t* p = s; *p; ++p)
349 *p = towlower(*p);
350 return s;
351}
352#endif
353#ifndef wcsrev
354inline wchar_t* wcsrev(wchar_t* s)
355{
356 if(!s)
357 return 0;
358 wchar_t* e = s + wcslen(s) - 1;
359 wchar_t* s_ = s;
360 while(s < e)
361 {
362 std::swap(*s, *e);
363 ++s;
364 --e;
365 }
366 return s_;
367}
368#endif
369
370#ifdef OD_STRING_FNS
371
372#ifndef stricmp
373#define stricmp Od_stricmpA
374#endif
375
376#ifndef strupr
377#define strupr Od_struprA
378#endif
379
380#ifndef strlwr
381#define strlwr Od_strlwrA
382#endif
383
384#ifndef strrev
385#define strrev Od_strrevA
386#endif
387
388#ifndef strnicmp
389#define strnicmp Od_strnicmpA
390#endif
391
392#endif //OD_STRING_FNS
393
394#endif //defined(__linux__) || defined(EMCC)
395
396#ifndef odStrICmp
397
398#if defined(_WINRT)
399#include <WinNls.h>
400#include <stringapiset.h>
401inline int Od_stricmpW(const OdChar* str, const OdChar* str2){ return CompareStringEx( LOCALE_NAME_INVARIANT, NORM_IGNORECASE, (const wchar_t*)str, -1, (const wchar_t*)str2, -1, NULL, NULL, 0) - 2; }
402#elif defined(_WIN32) ||defined(_WIN64) || defined(_WIN32_WCE)
403inline int Od_stricmpW(const OdChar* str, const OdChar* str2){ return CompareStringW( LOCALE_NEUTRAL, NORM_IGNORECASE, (const wchar_t*)str, -1, (const wchar_t*)str2, -1) - 2; }
404#elif (defined ( __BORLANDC__ ) && (__BORLANDC__) >= 0x530) ||(defined(_MSC_VER) && _MSC_VER > 1200)
405inline int Od_stricmpW(const OdChar* str, const OdChar* str2){ return _wcsicmp(str, str2); }
406#else
407inline int Od_stricmpW(const OdChar* str, const OdChar* str2){ return wcsicmp(str, str2); }
408#endif
409#define odStrICmp Od_stricmpW
410#endif
411
412#ifndef odStrICmpA
413#if defined(ODA_WINDOWS)
414#define odStrICmpA(str, str2) _stricmp(str, str2)
415#else
416#define odStrICmpA(str, str2) stricmp(str, str2)
417#endif
418#endif
419
420#ifndef odStrnICmp
421#if defined(_WINRT)
422#include <stringapiset.h>
423inline int Od_stricmpW(const OdChar* str, const OdChar* str2, size_t n){ return CompareStringEx( LOCALE_NAME_INVARIANT, NORM_IGNORECASE, (const wchar_t*)str, (int)odmin(wcslen((const wchar_t*)str), n), (const wchar_t*)str2, (int)odmin(wcslen((const wchar_t*)str), n), NULL, NULL, 0) - 2; }
424#elif defined(_WIN32) ||defined(_WIN64) || defined(_WIN32_WCE)
425inline int Od_stricmpW(const OdChar* str, const OdChar* str2, size_t n){ return CompareStringW( LOCALE_NEUTRAL, NORM_IGNORECASE, (const wchar_t*)str, (int)odmin(wcslen((const wchar_t*)str), n), (const wchar_t*)str2, (int)odmin(wcslen((const wchar_t*)str2), n))-2;}
426#elif (defined ( __BORLANDC__ ) && (__BORLANDC__) >= 0x530) || (defined(_MSC_VER) && _MSC_VER > 1200)
427inline int Od_stricmpW(const OdChar* str, const OdChar* str2, size_t n){ return _wcsnicmp(str, str2, n);}
428#else
429inline int Od_stricmpW(const OdChar* str, const OdChar* str2, size_t n){ return wcsnicmp(str, str2, n);}
430#endif
431#define odStrnICmp Od_stricmpW
432#endif
433
434#ifndef odStrnICmpA
435#if defined(ODA_WINDOWS)
436#define odStrnICmpA(str, str2, n) _strnicmp(str, str2, n)
437#else
438#define odStrnICmpA(str, str2, n) strnicmp(str, str2, n)
439#endif
440#endif
441
442
443#ifndef odStrUpr
444#if defined(ODA_WINDOWS) && !defined(_WINRT)
445inline OdChar* Od_struprW(OdChar* str){return (OdChar*)CharUpperW((wchar_t*)str);}
446#elif defined(_WINRT)
447inline OdChar* Od_struprW(OdChar* str){return (OdChar*)_wcsupr((wchar_t*)str);}
448#else
449inline OdChar* Od_struprW(OdChar* str){return (OdChar*)wcsupr((OdChar*)str);}
450#endif
451#define odStrUpr(str) Od_struprW(str)
452#endif
453
454#ifndef odStrUprA
455#if defined(ODA_WINDOWS)
456#define odStrUprA(str) _strupr(str)
457#else
458#define odStrUprA(str) strupr(str)
459#endif
460#endif
461
462#ifndef odStrLwr
463#if defined(ODA_WINDOWS) && !defined(_WINRT) && !defined(_WIN32_WCE)
464inline OdChar* Od_strlwrW(OdChar* str){return (OdChar*)CharLowerW((wchar_t*)str);}
465#elif defined (_WINRT) || defined(_WIN32_WCE)
466inline OdChar* Od_strlwrW(OdChar* str){return (OdChar*)_wcslwr((wchar_t*)str);}
467#else
468inline OdChar* Od_strlwrW(OdChar* str){return (OdChar*)wcslwr((OdChar*)str);}
469#endif
470#define odStrLwr(str) Od_strlwrW(str)
471#endif
472
473#ifndef odStrLwrA
474#if defined(ODA_WINDOWS)
475#define odStrLwrA(str) _strlwr(str)
476#else
477#define odStrLwrA(str) strlwr(str)
478#endif
479#endif
480
481#ifndef odStrRev
482#if defined(ODA_WINDOWS)
483inline OdChar* Od_strrevW(OdChar* str) {return (OdChar*)_wcsrev((wchar_t*)str);}
484#else
485inline OdChar* Od_strrevW(OdChar* str) {return (OdChar*)wcsrev((wchar_t*)str);}
486#endif
487#define odStrRev(str) Od_strrevW(str)
488#endif
489
490#ifndef odStrRevA
491#if defined(ODA_WINDOWS)
492#define odStrRevA(str) _strrev(str)
493#else
494#define odStrRevA(str) strrev(str)
495#endif
496#endif
497
498#ifndef odStrToInt
499inline long Od_strtoint(const OdChar* str){ return wcstol((const wchar_t*)str, 0, 10);}
500#define odStrToInt(str) Od_strtoint(str)
501#endif
502
503#ifndef odStrToUInt
504inline long Od_strtouint(const OdChar* str){ return wcstoul((const wchar_t*)str, 0, 10);}
505#define odStrToUInt(str) Od_strtouint(str)
506#endif
507
508#ifndef Od_isspace
509#define Od_isspace(ch) isspace(ch)
510#endif
511
512#ifndef Od_iswspace
513#if defined(_MSC_VER) && (_MSC_VER <= 1310)
514 #define Od_iswspace(ch) iswctype(ch,_SPACE)
515#else
516 #define Od_iswspace(ch) iswspace(ch)
517#endif
518#endif
519
520#ifndef Od_isdigit
521#define Od_isdigit(ch) isdigit(ch)
522#endif
523
524#ifndef Od_iswdigit
525#if defined(_MSC_VER) && (_MSC_VER <= 1310)
526 #define Od_iswdigit(ch) iswctype(ch,_DIGIT)
527#else
528 #define Od_iswdigit(ch) iswdigit(ch)
529#endif
530#endif
531
532
533#if (defined(sgi) || defined(_AIX) || defined(sparc)) && !defined(__GNUC__)
534#define TD_NEED_SWFNS
535#endif
536//FELIX_CHANGE_BEGIN
537/*
538#if defined(TD_NEED_SWFNS) || defined(__APPLE__) || defined(EMCC)// #7324
539*/
540#if defined(TD_NEED_SWFNS) || defined(__APPLE__) || defined(ANDROID) // #7324
541//FELIX_CHANGE_END
542#define TD_NEED_SWFNS_SCANF
543#endif
544//FELIX_CHANGE_BEGIN
545/*
546#if defined(TD_NEED_SWFNS) || defined(__APPLE__) || defined(__hpux) || defined(ANDROID) || defined(EMCC) || defined(ODA_WINDOWS_GCC) // #7324 & #8357 & #9786
547*/
548#if defined(TD_NEED_SWFNS) || defined(__APPLE__) || defined(__hpux) || (defined(ANDROID)) || defined(ODA_WINDOWS_GCC)
549//FELIX_CHANGE_END
550#define TD_NEED_SWFNS_PRINTF
551#endif
552
553#ifndef odSScanf
554 #if defined(TD_NEED_SWFNS_SCANF)
555 #ifdef ANDROID_WCHAR
556 #include "../../ThirdParty/wchar/wchar_.h"
557 #else
558 #include <wchar.h>
559 #endif
560 #include <stdio.h>
561 #include <stdarg.h>
562 #include <string>
563 FIRSTDLL_EXPORT int Od_vswscanfV(const wchar_t* buffer, const wchar_t* lpszFormat, va_list argList);
564 inline int ddswscanf(const wchar_t* buffer, const wchar_t* format, ...)
565 {
566 va_list argList;
567 va_start(argList, format);
568 int count = Od_vswscanfV(buffer, format, argList);
569 va_end(argList);
570 return count;
571 }
572 #define odSScanf ddswscanf
573 #else
574 #if defined(_WINRT)
575 #define odSScanf swscanf_s
576 #else
577 #define odSScanf swscanf
578 #endif
579 #endif
580#endif
581
582#ifndef odSprintf
583 #if defined(ODA_WINDOWS)
584 #define odSprintf _snwprintf
585 #elif defined(TD_NEED_SWFNS_PRINTF)
586 #include <stdio.h>
587 #include <stdarg.h>
588 #include <string>
589 FIRSTDLL_EXPORT extern std::wstring Od_vswprintfV(const wchar_t* lpszFormat, va_list argList);
590 inline int ddswprintf(wchar_t *buffer, size_t count, const wchar_t *format, ...)
591 {
592 va_list argList;
593 va_start(argList, format);
594 std::wstring ws = Od_vswprintfV(format, argList);
595 va_end(argList);
596 int toCopy = ws.length() < count - 1 ? ws.length() : count - 1;
597 Od_wcsncpy(buffer, ws.c_str(), toCopy);
598 buffer[toCopy] = '\0';
599 return 0;
600 }
601 #define odSprintf ddswprintf
602 #else
603 #define odSprintf swprintf
604 #endif
605#endif
606
607#ifndef odSprintfA
608 #if defined(ODA_WINDOWS)
609 #define odSprintfA _snprintf
610 #else
611 #define odSprintfA snprintf
612 #endif
613#endif
614
615#ifndef odStrToF
616#if defined (ODA_WINDOWS) && !defined(_WIN32_WCE)
617#define odStrToF _wtof
618#else
619#include <wchar.h>
620inline double Od_wtof(const wchar_t* str)
621{
622 wchar_t *endptr = 0;
623 return wcstod(str, &endptr);
624}
625#define odStrToF Od_wtof
626#endif
627#endif
628
629
630#ifndef OD_TYPENAME
631#define OD_TYPENAME
632#endif
633
634#ifndef OD_TYPENAME2
635#define OD_TYPENAME2
636#endif
637
638#ifndef OD_TYPENAME3
639#define OD_TYPENAME3
640#endif
641
642#ifndef OD_BSEARCH
643#define OD_BSEARCH ::bsearch
644#endif
645
646#ifndef TD_USING
647#define TD_USING(a) using a
648#endif
649
650#ifndef OD_LINKEDARRAY_SCOPE
651#define OD_LINKEDARRAY_SCOPE
652#endif
653
654#ifndef odStrStr
655 #ifdef TD_NEED_WCSSTR
656 // This is missing on some older HP compiler versions.
657 extern wchar_t *wcsstr(const wchar_t* wcs1, const wchar_t* wcs2);
658 #endif
659 #define odStrStr ::wcsstr
660#endif
661
663#define OD_MAKEWORD(a, b) ((OdUInt16)(((OdUInt8)(a)) | ((OdUInt16)((OdUInt8)(b))) << 8))
664#define OD_MAKELONG(a, b) ((OdInt32)(((OdUInt16)(a)) | ((OdUInt32)((OdUInt16)(b))) << 16))
665#define OD_LOWORD(l) ((OdUInt16)(l))
666#define OD_HIWORD(l) ((OdUInt16)(((OdUInt32)(l) >> 16) & 0xFFFF))
667#define OD_LOBYTE(w) ((OdUInt8)(w))
668#define OD_HIBYTE(w) ((OdUInt8)(((OdUInt16)(w) >> 8) & 0xFF))
669
670inline void odSwapBytes(OdUInt8& xX, OdUInt8& yY) { xX ^= yY; yY ^= xX; xX ^= yY; }
671inline void odSwapWords(OdUInt16& xX, OdUInt16& yY) { xX ^= yY; yY ^= xX; xX ^= yY; }
672
673#ifdef ODA_BIGENDIAN
674
675inline void odSwap2BytesNumber(OdUInt16& W)
676{
677 odSwapBytes(((OdUInt8*)&(W))[0], ((OdUInt8*)&(W))[1]);
678}
679
680inline void odSwap2BytesNumber(OdInt16& W)
681{
682 odSwapBytes(((OdUInt8*)&(W))[0], ((OdUInt8*)&(W))[1]);
683}
684
685inline void odSwap4BytesNumber(OdUInt32& DW)
686{
687 odSwapWords(((OdUInt16*)&(DW))[0], ((OdUInt16*)&(DW))[1]);
688 odSwapBytes(((OdUInt8*)&(DW))[0], ((OdUInt8*)&(DW))[1]);
689 odSwapBytes(((OdUInt8*)&(DW))[2], ((OdUInt8*)&(DW))[3]);
690}
691
692inline void odSwap4BytesNumber(OdInt32& DW)
693{
694 // NOTE: Using above unsigned version on AIX results in runtime errors.
695 // Macro version also causes errors on AIX.
696 OdInt8* p = (OdInt8*)&DW;
697 OdInt8 tmp;
698 tmp = p[0]; p[0] = p[3]; p[3] = tmp;
699 tmp = p[1]; p[1] = p[2]; p[2] = tmp;
700}
701
702#if OD_SIZEOF_LONG == 4
703inline void odSwap4BytesNumber(unsigned int& DW)
704{
705 odSwapWords(((OdUInt16*)&(DW))[0], ((OdUInt16*)&(DW))[1]);
706 odSwapBytes(((OdUInt8*)&(DW))[0], ((OdUInt8*)&(DW))[1]);
707 odSwapBytes(((OdUInt8*)&(DW))[2], ((OdUInt8*)&(DW))[3]);
708}
709#endif
710
711inline void odSwap8Bytes(void* pBytes)
712{
713 odSwapBytes(((OdUInt8*)(pBytes))[0], ((OdUInt8*)(pBytes))[7]);
714 odSwapBytes(((OdUInt8*)(pBytes))[1], ((OdUInt8*)(pBytes))[6]);
715 odSwapBytes(((OdUInt8*)(pBytes))[2], ((OdUInt8*)(pBytes))[5]);
716 odSwapBytes(((OdUInt8*)(pBytes))[3], ((OdUInt8*)(pBytes))[4]);
717}
718
719inline void odSwap4Bytes(void* pBytes)
720{
721 odSwapBytes(((OdUInt8*)(pBytes))[0], ((OdUInt8*)(pBytes))[3]);
722 odSwapBytes(((OdUInt8*)(pBytes))[1], ((OdUInt8*)(pBytes))[2]);
723}
724
725#define odSwapInt64(n)
726
727#else
728
729#define odSwap2BytesNumber(n)
730#define odSwap4BytesNumber(n)
731#define odSwap8Bytes(bytes)
732#define odSwap4Bytes(bytes)
733
734inline void odSwapInt64(void* pBytes)
735{
736 odSwapBytes(((OdUInt8*)(pBytes))[0], ((OdUInt8*)(pBytes))[7]);
737 odSwapBytes(((OdUInt8*)(pBytes))[1], ((OdUInt8*)(pBytes))[6]);
738 odSwapBytes(((OdUInt8*)(pBytes))[2], ((OdUInt8*)(pBytes))[5]);
739 odSwapBytes(((OdUInt8*)(pBytes))[3], ((OdUInt8*)(pBytes))[4]);
740}
741
742#endif // ODA_BIGENDIAN
743
748inline bool isValidNonZeroIEEEDouble(const OdUInt8 * buf)
749{
750#ifdef ODA_BIGENDIAN
751 int nExponent = (buf[0] & 0x7F) << 4 | (buf[1] & 0xF0) >> 4;
752#else
753 int nExponent = (buf[7] & 0x7F) << 4 | (buf[6] & 0xF0) >> 4;
754#endif
755 switch (nExponent)
756 {
757 case 0: // The value is zero or possibly denormalized
758 case 2047: // -INF, +INF or Nan
759 return false;
760 }
761 return true;
762}
763
764inline void fixDouble(double * pD)
765{
766 ODA_ASSUME(sizeof(double) == 8)
767 odSwap8Bytes(pD);
769 { // if unnormalized or NaN or infinity, set it to 0.0
770 //*pD = 0.;
771 ::memset((void*)pD, 0, sizeof(double)); // Support TD_STRICT_ALIGNMENT (#8352)
772 }
773}
774
775
776#define OD_INT8_FROM_BUFFPTR(pBuffPtr) *(pBuffPtr++)
777
779{
780 OdUInt32 low(*pBuffPtr++);
781 low |= ((OdUInt32)*pBuffPtr++) << 8;
782 low |= ((OdUInt32)*pBuffPtr++) << 16;
783 low |= ((OdUInt32)*pBuffPtr++) << 24;
784
785 OdUInt32 high(*pBuffPtr++);
786 high |= ((OdUInt32)*pBuffPtr++) << 8;
787 high |= ((OdUInt32)*pBuffPtr++) << 16;
788 high |= ((OdUInt32)*pBuffPtr++) << 24;
789
790 OdUInt64 res(high);
791 res <<= 32;
792 res |= low;
793 return res;
794}
795
796#define OD_BYTES_FROM_BUFFPTR(pBuffPtr, ResBuff, nCount) (pBuffPtr+=nCount, ::memcpy(ResBuff, pBuffPtr-nCount, nCount))
797
798#define OD_INT8_TO_BUFFPTR(pBuffPtr, val) (++pBuffPtr, pBuffPtr[-1] = OdUInt8(val))
799#define OD_BYTES_TO_BUFFPTR(pBuffPtr, FromBuff, nCount) (pBuffPtr+=nCount, ::memcpy(pBuffPtr-nCount, FromBuff, nCount))
800
801
802
803#ifndef ODA_BIGENDIAN
804
805#ifdef TD_STRICT_ALIGNMENT
806
807#if defined(_WIN32_WCE) || defined FX_TOUCH_VERSION // FELIX_CHANGE
808#define VISIBILITY_ATTR FIRSTDLL_EXPORT
809FIRSTDLL_EXPORT void *bsearch(const void *key, const void *base, size_t numeles, size_t widthele, int(__cdecl *cfunc)(const void *elem1, const void *elem2));
810#else
811#define VISIBILITY_ATTR extern
812#endif
813
814VISIBILITY_ATTR double getStrictDouble(OdUInt8** ppBuff);
815VISIBILITY_ATTR void setStrictDouble(OdUInt8** ppBuff, double d);
816VISIBILITY_ATTR void setStrictInt16(OdUInt8** ppBuff, OdInt16 val);
817VISIBILITY_ATTR void setStrictInt32(OdUInt8** ppBuff, OdInt32 val);
818VISIBILITY_ATTR void setStrictInt64(OdUInt8** ppBuff, OdInt64 val);
819
820#define OD_INT16_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 2, (OdInt16)( *(pBuffPtr - 2) \
821 | (*(pBuffPtr - 1) << 8)))
822#define OD_INT32_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 4, (OdInt32)( *(pBuffPtr - 4) \
823 | (*(pBuffPtr - 3) << 8) \
824 | (*(pBuffPtr - 2) << 16) \
825 | (*(pBuffPtr - 1) << 24)))
826
827#define OD_INT64_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 8, (OdInt64)( *(pBuffPtr - 8) \
828 | (OdInt64(*(pBuffPtr - 7)) << 8) \
829 | (OdInt64(*(pBuffPtr - 6)) << 16) \
830 | (OdInt64(*(pBuffPtr - 5)) << 24) \
831 | (OdInt64(*(pBuffPtr - 4)) << 32) \
832 | (OdInt64(*(pBuffPtr - 3)) << 40) \
833 | (OdInt64(*(pBuffPtr - 2)) << 48) \
834 | (OdInt64(*(pBuffPtr - 1)) << 56)))
835
836#define OD_DOUBLE_FROM_BUFFPTR(pBuffPtr) getStrictDouble(&pBuffPtr)
837
838#define OD_INT16_TO_BUFFPTR(pBuffPtr, val) setStrictInt16(&pBuffPtr, val)
839#define OD_INT32_TO_BUFFPTR(pBuffPtr, val) setStrictInt32(&pBuffPtr, val)
840#define OD_INT64_TO_BUFFPTR(pBuffPtr, val) setStrictInt64(&pBuffPtr, val)
841
842#define OD_DOUBLE_TO_BUFFPTR(pBuffPtr, val) setStrictDouble(&pBuffPtr, val)
843
844
845#else
846
847inline double getValidDouble(OdUInt8** ppBuff)
848{
849 double d = isValidNonZeroIEEEDouble(*ppBuff) ? *((double*)(*ppBuff)) : 0.0;
850 *ppBuff+=8;
851 return d;
852}
853
854#define OD_INT16_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 2, *((OdInt16*)(pBuffPtr - 2)))
855#define OD_INT32_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 4, *((OdInt32*)(pBuffPtr - 4)))
856#define OD_INT64_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 8, *((OdInt64*)(pBuffPtr - 8)))
857
858#define OD_DOUBLE_FROM_BUFFPTR(pBuffPtr) getValidDouble(&pBuffPtr)
859//#define OD_POINT3D_FROM_BUFFPTR(pBuffPtr) (pBuffPtr+=24, *((OdGePoint3d*)(pBuffPtr-24)))
860
861#define OD_INT16_TO_BUFFPTR(pBuffPtr, val) (pBuffPtr+=2, *((OdInt16*)(pBuffPtr-2)) = OdInt16(val))
862#define OD_INT32_TO_BUFFPTR(pBuffPtr, val) (pBuffPtr+=4, *((OdInt32*)(pBuffPtr-4)) = OdInt32(val))
863#define OD_INT64_TO_BUFFPTR(pBuffPtr, val) (pBuffPtr+=8, *((OdInt64*)(pBuffPtr-8)) = OdInt64(val))
864
865#define OD_DOUBLE_TO_BUFFPTR(pBuffPtr, val) (pBuffPtr+=8, *((double*)(pBuffPtr-8)) = double(val))
866//#define OD_POINT3D_TO_BUFFPTR(pBuffPtr, val) (pBuffPtr+=24, *((OdGePoint3d*)(pBuffPtr-24)) = val)
867
868#endif // TD_STRICT_ALIGNMENT
869
870
871#else
872
873
874extern double getBeDouble(OdUInt8** ppBuff);
875//extern OdGePoint3d getBePnt3d(OdUInt8** ppBuff);
876extern void setStrictInt16(OdUInt8** ppBuff, OdInt16 val);
877extern void setStrictInt32(OdUInt8** ppBuff, OdInt32 val);
878extern void setStrictInt64(OdUInt8** ppBuff, OdInt64 val);
879extern void setBeDouble(OdUInt8** ppBuff, double d);
880//extern void setBePnt3(OdUInt8** ppBuff, const OdGePoint3d& p);
881
882
883// SGI doesn't like these versions.
884//#define OD_INT16_FROM_BUFFPTR(pBuffPtr) ((OdInt16)(*pBuffPtr++ | (*pBuffPtr++ << 8)))
885//#define OD_INT32_FROM_BUFFPTR(pBuffPtr) ((OdInt32)(*pBuffPtr++ | (*pBuffPtr++ << 8) | (*pBuffPtr++ << 16) | (*pBuffPtr++ << 24)))
886// So use these instead
887#define OD_INT16_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 2, (OdInt16)( *(pBuffPtr - 2) \
888 | (*(pBuffPtr - 1) << 8)))
889#define OD_INT32_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 4, (OdInt32)( *(pBuffPtr - 4) \
890 | (*(pBuffPtr - 3) << 8) \
891 | (*(pBuffPtr - 2) << 16) \
892 | (*(pBuffPtr - 1) << 24)))
893#define OD_INT64_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 8, (OdInt64)( *(pBuffPtr - 8) \
894 | (((OdInt64)(*(pBuffPtr - 7))) << 8) \
895 | (((OdInt64)(*(pBuffPtr - 6))) << 16) \
896 | (((OdInt64)(*(pBuffPtr - 5))) << 24) \
897 | (((OdInt64)(*(pBuffPtr - 4))) << 32) \
898 | (((OdInt64)(*(pBuffPtr - 3))) << 40) \
899 | (((OdInt64)(*(pBuffPtr - 2))) << 48) \
900 | (((OdInt64)(*(pBuffPtr - 1))) << 56)))
901
902#define OD_DOUBLE_FROM_BUFFPTR(pBuffPtr) getBeDouble(&pBuffPtr)
903//#define OD_POINT3D_FROM_BUFFPTR(pBuffPtr) getBePnt3d(&pBuffPtr)
904
905#define OD_INT16_TO_BUFFPTR(pBuffPtr, val) setStrictInt16(&pBuffPtr, val)
906#define OD_INT32_TO_BUFFPTR(pBuffPtr, val) setStrictInt32(&pBuffPtr, val)
907#define OD_INT64_TO_BUFFPTR(pBuffPtr, val) setStrictInt64(&pBuffPtr, val)
908
909#define OD_DOUBLE_TO_BUFFPTR(pBuffPtr, val) setBeDouble(&pBuffPtr, val)
910//#define OD_POINT3D_TO_BUFFPTR(pBuffPtr, val) setBePnt3(&pBuffPtr, val)
911
912#endif // ODA_BIGENDIAN
913
914
915#if defined(ODA_WINDOWS)
916#include "WINDOWS.H"
917#include "WINGDI.H"
918#endif
919
920#if defined(_WIN32) && !defined(WIN64) && !defined(_WINRT)
921// COLORREF on WIN64 is 8 bytes
922#define ODCOLORREF COLORREF
923#define ODRGB(r,g,b) RGB(r,g,b)
924#define ODRGBA(r,g,b,a) (((ODCOLORREF)ODRGB(r,g,b))|(((DWORD)(BYTE)(a))<<24))
925#define ODGETRED(rgb) GetRValue(rgb)
926#define ODGETGREEN(rgb) GetGValue(rgb)
927#define ODGETBLUE(rgb) GetBValue(rgb)
928#define ODGETALPHA(rgba) ((BYTE)((rgba)>>24))
929#define ODRECT RECT
930
931#else //#ifdef _WIN32
932
933#define ODCOLORREF OdUInt32
934#define ODRGB(r,g,b) ((ODCOLORREF)(((OdUInt8)(r)|((OdUInt16)((OdUInt8)(g))<<8))|(((OdUInt32)(OdUInt8)(b))<<16)))
935#define ODRGBA(r,g,b,a) (((ODCOLORREF)ODRGB(r,g,b))|(((OdUInt32)(OdUInt8)(a))<<24))
936
937#define ODGETRED(rgb) ((OdUInt8)(rgb))
938#define ODGETGREEN(rgb) ((OdUInt8)(((OdUInt16)(rgb)) >> 8))
939#define ODGETBLUE(rgb) ((OdUInt8)((rgb)>>16))
940#define ODGETALPHA(rgba) ((OdUInt8)((rgba)>>24))
941
942typedef struct OdTagRECT{
948
949#if (!defined(WIN64) && !defined(ODA_WINDOWS_GCC)) || defined(_WINRT)
950
951#if !defined(_WINRT)
952#ifndef RGBQUAD_DEFINED
953#define RGBQUAD_DEFINED
954#if defined(__sun)
955#pragma pack(2)
956#else
957#pragma pack(push,2)
958#endif
962 typedef struct tagRGBQUAD
963{
969#if defined(__sun)
970#pragma pack()
971#else
972#pragma pack(pop)
973#endif
974#endif
975
976#ifndef BITMAPINFOHEADER_DEFINED
977#define BITMAPINFOHEADER_DEFINED
981#if defined(__sun)
982#pragma pack(2)
983#else
984#pragma pack(push,2)
985#endif
986
987typedef struct tagBITMAPINFOHEADER {
1000
1001//FELIX_CHANGE_BEGIN
1003
1004typedef struct tagCIEXYZ
1005{
1010
1011typedef struct tagICEXYZTRIPLE
1012{
1017
1018typedef struct tagBITMAPV4HEADER {
1040//FELIX_CHANGE_BEGIN
1041
1042#if defined(__sun)
1043#pragma pack()
1044#else
1045#pragma pack(pop)
1046#endif
1047
1048#endif
1049
1050#ifndef BITMAPINFO_DEFINED
1051#define BITMAPINFO_DEFINED
1052typedef struct tagBITMAPINFO {
1056
1057#endif //BITMAPINFO_DEFINED
1058
1059#endif //_WINRT
1060#ifndef BITMAPFILEHEADER_DEFINED
1061#define BITMAPFILEHEADER_DEFINED
1062#if defined(__sun)
1063#pragma pack(2)
1064#else
1065#pragma pack(push,2)
1066#endif
1070 typedef struct tagBITMAPFILEHEADER
1071{
1078#if defined(__sun)
1079#pragma pack()
1080#else
1081#pragma pack(pop)
1082#endif
1083#endif
1084
1085#endif //#ifndef WIN64
1086#endif //#ifdef _WIN32
1087
1088#ifndef ODA_WINDOWS
1089#ifndef CLSID
1090#define CLSID OdGUID
1091#endif
1092#endif
1093
1094#define ODTOCMCOLOR(colorref) OdCmEntityColor( ODGETRED(colorref), ODGETGREEN(colorref), ODGETBLUE(colorref) )
1095#define ODTOCOLORREF(cmColor) ODRGB( cmColor.red(), cmColor.green(), cmColor.blue() )
1096
1098// IR.111706. MacOS X dynamic library loading.
1099// Some code taken from Dlcompat open source library.
1100// www.opendarwin.org/projects/dlcompat/
1101
1102#if defined(_TOOLKIT_IN_DLL_) && defined(__GNUC__) && defined(__APPLE__) // GNU compiler MacOS X
1103
1104#include <mach-o/dyld.h>
1105
1106# ifndef RTLD_LAZY
1107# define RTLD_LAZY 0x1
1108# endif
1109# ifndef RTLD_NOW
1110# define RTLD_NOW 0x2
1111# endif
1112# ifndef RTLD_LOCAL
1113# define RTLD_LOCAL 0x4
1114# endif
1115# ifndef RTLD_GLOBAL
1116# define RTLD_GLOBAL 0x8
1117# endif
1118# ifndef RTLD_NOLOAD
1119# define RTLD_NOLOAD 0x10
1120# endif
1121# ifndef RTLD_NODELETE
1122# define RTLD_NODELETE 0x80
1123# endif
1124
1125class OdString;
1126void* LoadSharedLibrary(const OdString& path, int mode = 2);
1127void *GetFunction(void *handle, char *symbol);
1128bool FreeSharedLibrary(void *handle);
1129
1130#endif //defined(__GNUC__) && defined(__APPLE__) // GNU compiler MacOS X
1131
1132#if defined(_TOOLKIT_IN_DLL_) && defined(__GNUC__) && !defined(__APPLE__) // GNU compiler Linux
1133
1134#include <dlfcn.h>
1135
1136#endif // defined(_TOOLKIT_IN_DLL_) && defined(__GNUC__) && !defined(__APPLE__) // GNU compiler Linux
1137
1138#include <time.h>
1139
1140FIRSTDLL_EXPORT size_t od_strftime(char *s, size_t maxsize, const char *format, const struct tm *t);
1141
1142#ifdef _WIN32_WCE
1143#include <winbase.h>
1144FIRSTDLL_EXPORT time_t TimeFromSystemTime(const SYSTEMTIME * pTime);
1145#endif
1146
1148// memory manipulation functions
1149// secure (with check params and throw exceptions)
1150FIRSTDLL_EXPORT void *Od_memcpy_s(void *dest, size_t destSize, const void *src, size_t count);
1151FIRSTDLL_EXPORT void *Od_memcpy_s(void *dest, const void *src, size_t count);
1152FIRSTDLL_EXPORT void *Od_memmove_s(void *dest, size_t destSize, const void *src, size_t count);
1153FIRSTDLL_EXPORT void *Od_memmove_s(void *dest, const void *src, size_t count);
1154// always insecure wrappers
1155FIRSTDLL_EXPORT inline void *Od_memcpy(void *dest, const void *src, size_t count) { return memcpy(dest, src, count); };
1156FIRSTDLL_EXPORT inline void *Od_memmove(void *dest, const void *src, size_t count) { return memmove(dest, src, count); };
1157#endif // _OD_PLATFORM_H_
#define ODA_ASSUME(expr)
Definition: DebugStuff.h:180
tm
Definition: DimVarDefs.h:2122
double Od_wtof(const wchar_t *str)
Definition: OdPlatform.h:620
struct tagBITMAPINFOHEADER * PBITMAPINFOHEADER
FIRSTDLL_EXPORT void * Od_memcpy(void *dest, const void *src, size_t count)
Definition: OdPlatform.h:1155
OdChar * Od_strrevW(OdChar *str)
Definition: OdPlatform.h:485
struct tagBITMAPFILEHEADER BITMAPFILEHEADER
#define odSwap4BytesNumber(n)
Definition: OdPlatform.h:730
bool isValidNonZeroIEEEDouble(const OdUInt8 *buf)
Definition: OdPlatform.h:748
#define Od_abs
Definition: OdPlatform.h:141
void odSwapBytes(OdUInt8 &xX, OdUInt8 &yY)
Definition: OdPlatform.h:670
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
struct OdTagRECT ODRECT
struct tagRGBQUAD RGBQUAD
double getValidDouble(OdUInt8 **ppBuff)
Definition: OdPlatform.h:847
long Od_strtouint(const OdChar *str)
Definition: OdPlatform.h:504
#define odSwap4Bytes(bytes)
Definition: OdPlatform.h:732
struct tagICEXYZTRIPLE CIEXYZTRIPLE
#define odmin(X, Y)
Definition: OdPlatform.h:34
FIRSTDLL_EXPORT size_t od_strftime(char *s, size_t maxsize, const char *format, const struct tm *t)
int Od_stricmpW(const OdChar *str, const OdChar *str2)
Definition: OdPlatform.h:407
void fixDouble(double *pD)
Definition: OdPlatform.h:764
OdChar * Od_struprW(OdChar *str)
Definition: OdPlatform.h:449
OdInt32 FXPT2DOT30
Definition: OdPlatform.h:1002
struct tagRGBQUAD * LPRGBQUAD
FIRSTDLL_EXPORT void * Od_memcpy_s(void *dest, size_t destSize, const void *src, size_t count)
void odSwapInt64(void *pBytes)
Definition: OdPlatform.h:734
struct tagBITMAPINFO * PBITMAPINFO
struct tagBITMAPV4HEADER * PBITMAPV4HEADER
struct tagBITMAPV4HEADER BITMAPV4HEADER
FIRSTDLL_EXPORT void * Od_memmove(void *dest, const void *src, size_t count)
Definition: OdPlatform.h:1156
long Od_strtoint(const OdChar *str)
Definition: OdPlatform.h:499
struct tagBITMAPINFO BITMAPINFO
FIRSTDLL_EXPORT void * Od_memmove_s(void *dest, size_t destSize, const void *src, size_t count)
#define odSwap8Bytes(bytes)
Definition: OdPlatform.h:731
OdChar * Od_strlwrW(OdChar *str)
Definition: OdPlatform.h:468
#define OD_INT64_FROM_BUFFPTR(pBuffPtr)
Definition: OdPlatform.h:856
#define Od_wcsncpy
Definition: OdPlatform.h:155
struct tagBITMAPFILEHEADER * PBITMAPFILEHEADER
struct tagCIEXYZ CIEXYZ
#define Od_round
Definition: OdPlatform.h:170
#define odSwap2BytesNumber(n)
Definition: OdPlatform.h:729
void odSwapWords(OdUInt16 &xX, OdUInt16 &yY)
Definition: OdPlatform.h:671
unsigned int OdUInt32
short OdInt16
signed char OdInt8
unsigned short OdUInt16
int OdInt32
unsigned char OdUInt8
wchar_t OdChar
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
Definition: Int64.h:43
GLuint buffer
Definition: gles2_ext.h:178
GLsizei GLsizei * count
Definition: gles2_ext.h:276
GLint GLint GLint GLsizei GLsizei GLenum format
Definition: gles2_ext.h:111
OdInt32 bottom
Definition: OdPlatform.h:946
OdInt32 top
Definition: OdPlatform.h:944
OdInt32 right
Definition: OdPlatform.h:945
OdInt32 left
Definition: OdPlatform.h:943
OdUInt32 biCompression
Definition: OdPlatform.h:993
OdUInt32 biSizeImage
Definition: OdPlatform.h:994
OdInt32 biXPelsPerMeter
Definition: OdPlatform.h:995
OdInt32 biYPelsPerMeter
Definition: OdPlatform.h:996
OdUInt32 biClrImportant
Definition: OdPlatform.h:998
BITMAPINFOHEADER bmiHeader
Definition: OdPlatform.h:1053
RGBQUAD bmiColors[1]
Definition: OdPlatform.h:1054
OdUInt32 bV4ClrUsed
Definition: OdPlatform.h:1028
OdUInt32 bV4ClrImportant
Definition: OdPlatform.h:1029
OdUInt16 bV4Planes
Definition: OdPlatform.h:1022
OdUInt32 bV4AlphaMask
Definition: OdPlatform.h:1033
OdUInt32 bV4SizeImage
Definition: OdPlatform.h:1025
OdUInt16 bV4BitCount
Definition: OdPlatform.h:1023
OdInt32 bV4XPelsPerMeter
Definition: OdPlatform.h:1026
OdUInt32 bV4RedMask
Definition: OdPlatform.h:1030
OdUInt32 bV4GreenMask
Definition: OdPlatform.h:1031
OdUInt32 bV4GammaRed
Definition: OdPlatform.h:1036
OdUInt32 bV4V4Compression
Definition: OdPlatform.h:1024
CIEXYZTRIPLE bV4Endpoints
Definition: OdPlatform.h:1035
OdUInt32 bV4BlueMask
Definition: OdPlatform.h:1032
OdUInt32 bV4CSType
Definition: OdPlatform.h:1034
OdInt32 bV4YPelsPerMeter
Definition: OdPlatform.h:1027
OdUInt32 bV4GammaGreen
Definition: OdPlatform.h:1037
OdUInt32 bV4GammaBlue
Definition: OdPlatform.h:1038
FXPT2DOT30 ciexyzZ
Definition: OdPlatform.h:1008
FXPT2DOT30 ciexyzX
Definition: OdPlatform.h:1006
FXPT2DOT30 ciexyzY
Definition: OdPlatform.h:1007
CIEXYZ ciexyzGreen
Definition: OdPlatform.h:1014
OdUInt8 rgbBlue
Definition: OdPlatform.h:964
OdUInt8 rgbGreen
Definition: OdPlatform.h:965
OdUInt8 rgbReserved
Definition: OdPlatform.h:967
OdUInt8 rgbRed
Definition: OdPlatform.h:966