27#ifndef _OD_PLATFORM_H_
28#define _OD_PLATFORM_H_
42template<
class T,
class U,
typename std::enable_if<sizeof(T) >= sizeof(U) && std::is_arithmetic<T>::value && std::is_arithmetic<U>::value && std::is_
unsigned<T>::value == std::is_
unsigned<U>::value,
bool>
::type =
true>
45 return odmax(a,
static_cast<T
>(b));
47template<
class T,
class U,
typename std::enable_if<sizeof(T) >= sizeof(U) && std::is_arithmetic<T>::value && std::is_arithmetic<U>::value && std::is_
unsigned<T>::value && std::is_
signed<U>::value,
bool>
::type =
true>
50 return b < 0 ? a : odmax(a, static_cast<T>(b));
52template<
class T,
class U,
typename std::enable_if<(sizeof(T) > sizeof(U)) && std::is_arithmetic<T>::value && std::is_arithmetic<U>::value && std::is_
signed<T>::value && std::is_
unsigned<U>::value,
bool>
::type =
true>
55 return a < 0 ? static_cast<T>(b) :
odmax(a,
static_cast<T
>(b));
57template<
class T,
class U,
typename std::enable_if<(sizeof(T) < sizeof(U)) || (sizeof(T) == sizeof(U) && std::is_
signed<T>::value && std::is_
unsigned<U>::value),
bool>::type = true>
58ODRX_CONSTEXPR U odmax(T a, U b)
68template<
class T,
class U,
typename std::enable_if<sizeof(T) >= sizeof(U) && std::is_arithmetic<T>::value && std::is_arithmetic<U>::value && std::is_
unsigned<T>::value == std::is_
unsigned<U>::value,
bool>
::type =
true>
71 return odmin(a,
static_cast<T
>(b));
73template<
class T,
class U,
typename std::enable_if<sizeof(T) >= sizeof(U) && std::is_arithmetic<T>::value && std::is_arithmetic<U>::value && std::is_
unsigned<T>::value && std::is_
signed<U>::value,
bool>
::type =
true>
76 return b < 0 ? b : static_cast<U>(
odmin(a,
static_cast<T
>(b)));
78template<
class T,
class U,
typename std::enable_if<(sizeof(T) > sizeof(U)) && std::is_arithmetic<T>::value && std::is_arithmetic<U>::value && std::is_
signed<T>::value && std::is_
unsigned<U>::value,
bool>
::type =
true>
81 return a < 0 ? a : odmin(a, static_cast<T>(b));
83template<
class T,
class U,
typename std::enable_if<sizeof(T) <= sizeof(U) && std::is_
signed<T>::value && std::is_
unsigned<U>::value,
bool>::type = true>
84ODRX_CONSTEXPR T odmin(T a, U b)
88template<
class T,
class U,
typename std::enable_if<sizeof(T) < sizeof(U) && !(std::is_
signed<T>::value && std::is_
unsigned<U>::value),
bool>::type = true>
89ODRX_CONSTEXPR U odmin(T a, U b)
94#if defined(ODA_WINDOWS)
97#define Odisnan(x) (::_isnan(x) != 0)
98#define Odfinite(x) (::_finite(x) != 0)
99#ifndef OD_USE_EXTENDED_FUNCTIONS
100#define GETSS(s,n) ::fgets(s, n, stdin)
101#define OdWpr
intf wpr
intf
102#define OdPr
intf pr
intf
104#define GETSS(s,n) ::gets_s(s,n)
105#define OdWpr
intf _wpr
intf_p
106#define OdPr
intf _pr
intf_p
109#ifdef ODA_WINDOWS_GCC
113#if defined(_MSC_VER) && (_MSC_VER < 1400)
115#define GET_X_LPARAM(lParam) ((
int)(
short)LOWORD(lParam))
118#define GET_Y_LPARAM(lParam) ((
int)(
short)HIWORD(lParam))
125#define GETSS(s, n) fgets(s, n, stdin)
128#define MAX_PATH PATH_MAX
131#define OdWpr
intf wpr
intf
132#define OdPr
intf pr
intf
134#if defined(__APPLE__) || defined(__GNUC__) && ( __GNUC__>=5 || __GNUC__==4 && __GNUC_MINOR__>=9 )
136#define Odisnan(x) std::isnan(x)
137#define Odfinite(x) std::isfinite(x)
144#define Odisnan(x) std::isnan(x)
145#define Odfinite(x) (finite(x) != 0)
164#include "../../ThirdParty/wchar/stdlib_.h"
165#include "../../ThirdParty/wchar/wchar_.h"
166#define Od_atof Citrus::atof
167#define Od_abs Citrus::abs
168#define Od_labs Citrus::labs
169#define Od_llabs Citrus::llabs
170#define Od_srand Citrus::srand
171#define Od_rand Citrus::rand
172#define Od_wcstombs Citrus::wcstombs
173#define Od_wcscpy Citrus::wcscpy
174#define Od_wcscmp Citrus::wcscmp
175#define Od_wcscat Citrus::wcscat
176#define Od_wcschr Citrus::wcschr
177#define Od_wcscpy Citrus::wcscpy
178#define Od_wcslen Citrus::wcslen
179#define Od_wcsncpy Citrus::wcsncpy
182#if defined(_MSC_VER) && (_MSC_VER < 1600)
189#if defined(__BCPLUSPLUS__) || defined(__BORLANDC__) || defined(__sun)
192#if OD_SIZEOF_LONG == 4
193inline int Od_abs(
int val) {
return std::abs(val); }
195inline double Od_abs(
double val) {
return std::fabs(val); }
197#define Od_abs std::abs
201#define Od_labs std::labs
202#define Od_llabs std::llabs
203#define Od_srand srand
205#define Od_wcstombs wcstombs
206#define Od_wcscpy wcscpy
207#define Od_wcscmp wcscmp
208#define Od_wcscat wcscat
209#define Od_wcschr wcschr
210#define Od_wcslen wcslen
211#define Od_wcsncpy wcsncpy
214#if defined(_MSC_VER) && (_MSC_VER < 1800)
219 if (a - floor(a) >= 0.5)
220 result = floor(a) + 1;
226#define Od_round std::round
230#define odStrChr(str, ch) strchr(str, ch)
234#define odWStrChr(str, ch) Od_wcschr(str, ch)
245FIRSTDLL_EXPORT extern int Od_strnicmpA(
const char *s1,
const char *s2,
int len);
246FIRSTDLL_EXPORT extern int Od_stricmpA(
const char* str,
const char* str2);
251#if !defined(_WIN32_WCE)
252#define odStrUpr(str) Od_strupr(str)
253#define odStrLwr(str) Od_strlwr(str)
254#define odStrRev(str) Od_strrev(str)
260#if !defined(__linux__) && !defined(_WIN32_WCE) || defined(ANDROID)
261#define odStrICmp(str, str2) Od_stricmp(str, str2)
262#define odStrnICmp(str, str2, n) Od_strnicmp(str, str2, n)
263#define odStrnICmpA Od_strnicmpA
264#define odStrICmpA(str, str2) Od_stricmpA(str, str2)
265#define odStrUprA(str) Od_struprA(str)
266#define odStrLwrA(str) Od_strlwrA(str)
267#define odStrRevA(str) Od_strrevA(str)
328#define odStrLen(str) wcslen(str)
332#define odStrLenA(str) strlen(str)
336#define odStrCmp(str, str2) wcscmp(str, str2)
340#define odStrCmpA(str, str2) strcmp(str, str2)
343#if defined(ODA_WINDOWS)
349#if defined(ODA_WINDOWS)
350#ifndef WIN32_LEAN_AND_MEAN
351#define WIN32_LEAN_AND_MEAN
355#if defined( ANDROID ) || defined ( _WIN32_WCE ) || (defined (_MSC_VER) && _MSC_VER < 1400) || defined(_WINRT)
359 #define OFFSETTYPE(offset) (long)offset
361#elif defined(__APPLE__) || defined( __hpux )
365 #define OFFSETTYPE(offset) offset
367 #define FSEEK fseeko64
368 #define FTELL ftello64
369 #define FOPEN fopen64
370 #define OFFSETTYPE(offset) offset
373#if defined(__linux__) || defined(EMCC)
375#if !defined(EMCC) && !defined(__clang__)
376#include <bits/stl_algobase.h>
381#define wcsicmp wcscasecmp
385#define wcsnicmp wcsncasecmp
389inline wchar_t* wcsupr(
wchar_t* s)
393 for(
wchar_t* p = s; *p; ++p)
400inline wchar_t* wcslwr(
wchar_t* s)
404 for(
wchar_t* p = s; *p; ++p)
410inline wchar_t* wcsrev(
wchar_t* s)
414 wchar_t* e = s + wcslen(s) - 1;
429#define stricmp Od_stricmpA
433#define strupr Od_struprA
437#define strlwr Od_strlwrA
441#define strrev Od_strrevA
445#define strnicmp Od_strnicmpA
456#include <stringapiset.h>
457inline 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; }
458#elif defined(_WIN32) ||defined(_WIN64) || defined(_WIN32_WCE)
459inline 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; }
460#elif (defined ( __BORLANDC__ ) && (__BORLANDC__) >= 0x530) ||(defined(_MSC_VER) && _MSC_VER > 1200)
461inline int Od_stricmpW(
const OdChar* str,
const OdChar* str2){
return _wcsicmp(str, str2); }
463inline int Od_stricmpW(
const OdChar* str,
const OdChar* str2){
return wcsicmp(str, str2); }
465#define odStrICmp Od_stricmpW
469#if defined(ODA_WINDOWS)
470#define odStrICmpA(str, str2) _stricmp(str, str2)
472#define odStrICmpA(str, str2) stricmp(str, str2)
478#include <stringapiset.h>
479inline 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; }
480#elif defined(_WIN32) ||defined(_WIN64) || defined(_WIN32_WCE)
481inline 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;}
482#elif (defined ( __BORLANDC__ ) && (__BORLANDC__) >= 0x530) || (defined(_MSC_VER) && _MSC_VER > 1200)
483inline int Od_stricmpW(
const OdChar* str,
const OdChar* str2,
size_t n){
return _wcsnicmp(str, str2, n);}
485inline int Od_stricmpW(
const OdChar* str,
const OdChar* str2,
size_t n){
return wcsnicmp(str, str2, n);}
487#define odStrnICmp Od_stricmpW
491#if defined(ODA_WINDOWS)
492#define odStrnICmpA(str, str2, n) _strnicmp(str, str2, n)
494#define odStrnICmpA(str, str2, n) strnicmp(str, str2, n)
500#if defined(ODA_WINDOWS) && !defined(_WINRT)
507#define odStrUpr(str) Od_struprW(str)
511#if defined(ODA_WINDOWS)
512#define odStrUprA(str) _strupr(str)
514#define odStrUprA(str) strupr(str)
519#if defined(ODA_WINDOWS) && !defined(_WINRT) && !defined(_WIN32_WCE)
521#elif defined (_WINRT) || defined(_WIN32_WCE)
526#define odStrLwr(str) Od_strlwrW(str)
530#if defined(ODA_WINDOWS)
531#define odStrLwrA(str) _strlwr(str)
533#define odStrLwrA(str) strlwr(str)
538#if defined(ODA_WINDOWS)
543#define odStrRev(str) Od_strrevW(str)
547#if defined(ODA_WINDOWS)
548#define odStrRevA(str) _strrev(str)
550#define odStrRevA(str) strrev(str)
555inline long Od_strtoint(
const OdChar* str){
return wcstol((
const wchar_t*)str, 0, 10);}
556#define odStrToInt(str) Od_strtoint(str)
560inline unsigned long Od_strtouint(
const OdChar* str){
return wcstoul((
const wchar_t*)str, 0, 10);}
561#define odStrToUInt(str) Od_strtouint(str)
565#define Od_isspace(ch) isspace(ch)
569#if defined(_MSC_VER) && (_MSC_VER <= 1310)
570 #define Od_iswspace(ch) iswctype(ch,_SPACE)
572 #define Od_iswspace(ch) iswspace(ch)
577#define Od_isdigit(ch) isdigit(ch)
581#if defined(_MSC_VER) && (_MSC_VER <= 1310)
582 #define Od_iswdigit(ch) iswctype(ch,_DIGIT)
584 #define Od_iswdigit(ch) iswdigit(ch)
589#if (defined(sgi) || defined(_AIX) || defined(sparc)) && !defined(__GNUC__)
596#if defined(TD_NEED_SWFNS) || defined(__APPLE__) || defined(ANDROID)
598#define TD_NEED_SWFNS_SCANF
604#if defined(TD_NEED_SWFNS) || defined(__APPLE__) || defined(__hpux) || (defined(ANDROID)) || defined(ODA_WINDOWS_GCC)
606#define TD_NEED_SWFNS_PRINTF
610 #if defined(TD_NEED_SWFNS_SCANF)
612 #include "../../ThirdParty/wchar/wchar_.h"
620 inline int ddswscanf(
const wchar_t*
buffer,
const wchar_t*
format, ...)
623 va_start(argList,
format);
628 #define odSScanf ddswscanf
631 #define odSScanf swscanf_s
633 #define odSScanf swscanf
639 #if defined(ODA_WINDOWS)
640 #define odSprintf _snwprintf
641 #elif defined(TD_NEED_SWFNS_PRINTF)
645 FIRSTDLL_EXPORT extern std::wstring Od_vswprintfV(
const wchar_t* lpszFormat, va_list argList);
649 va_start(argList,
format);
650 std::wstring ws = Od_vswprintfV(
format, argList);
652 size_t toCopy = ws.length() <
count - 1 ? ws.length() :
count - 1;
657 #define odSprintf ddswprintf
659 #define odSprintf swprintf
664 #if defined(ODA_WINDOWS)
665 #define odSprintfA _snprintf
667 #define odSprintfA snprintf
672#if defined (ODA_WINDOWS) && !defined(_WIN32_WCE)
673#define odStrToF _wtof
676inline double Od_wtof(
const wchar_t* str)
679 return wcstod(str, &endptr);
681#define odStrToF Od_wtof
699#define OD_BSEARCH ::bsearch
703#define TD_USING(a) using a
706#ifndef OD_LINKEDARRAY_SCOPE
707#define OD_LINKEDARRAY_SCOPE
711 #ifdef TD_NEED_WCSSTR
713 extern wchar_t *wcsstr(
const wchar_t* wcs1,
const wchar_t* wcs2);
715 #define odStrStr ::wcsstr
719#define OD_MAKEWORD(a, b) ((OdUInt16)(((OdUInt8)(a)) | ((OdUInt16)((OdUInt8)(b))) << 8))
720#define OD_MAKELONG(a, b) ((OdInt32)(((OdUInt16)(a)) | ((OdUInt32)((OdUInt16)(b))) << 16))
721#define OD_LOWORD(l) ((OdUInt16)(l))
722#define OD_HIWORD(l) ((OdUInt16)(((OdUInt32)(l) >> 16) & 0xFFFF))
723#define OD_LOBYTE(w) ((OdUInt8)(w))
724#define OD_HIBYTE(w) ((OdUInt8)(((OdUInt16)(w) >> 8) & 0xFF))
726inline void odSwapBytes(
OdUInt8& xX,
OdUInt8& yY) { xX ^= yY; yY ^= xX; xX ^= yY; }
727inline void odSwapWords(
OdUInt16& xX,
OdUInt16& yY) { xX ^= yY; yY ^= xX; xX ^= yY; }
754 tmp = p[0]; p[0] = p[3]; p[3] = tmp;
755 tmp = p[1]; p[1] = p[2]; p[2] = tmp;
758#if OD_SIZEOF_LONG == 4
781#define odSwapInt64(n)
785#define odSwap2BytesNumber(n)
786#define odSwap4BytesNumber(n)
787#define odSwap8Bytes(bytes)
788#define odSwap4Bytes(bytes)
790inline void odSwapInt64(
void* pBytes)
804inline bool isValidNonZeroIEEEDouble(
const OdUInt8 * buf)
807 int nExponent = (buf[0] & 0x7F) << 4 | (buf[1] & 0xF0) >> 4;
809 int nExponent = (buf[7] & 0x7F) << 4 | (buf[6] & 0xF0) >> 4;
820inline void fixDouble(
double * pD)
824 if (!isValidNonZeroIEEEDouble((
OdUInt8 *)pD))
827 ::memset((
void*)pD, 0,
sizeof(
double));
832#define OD_INT8_FROM_BUFFPTR(pBuffPtr) *(pBuffPtr++)
837 low |= ((
OdUInt32)*pBuffPtr++) << 8;
838 low |= ((
OdUInt32)*pBuffPtr++) << 16;
839 low |= ((
OdUInt32)*pBuffPtr++) << 24;
842 high |= ((
OdUInt32)*pBuffPtr++) << 8;
843 high |= ((
OdUInt32)*pBuffPtr++) << 16;
844 high |= ((
OdUInt32)*pBuffPtr++) << 24;
852#define OD_BYTES_FROM_BUFFPTR(pBuffPtr, ResBuff, nCount) (pBuffPtr+=nCount, ::memcpy(ResBuff, pBuffPtr-nCount, nCount))
854#define OD_INT8_TO_BUFFPTR(pBuffPtr, val) (++pBuffPtr, pBuffPtr[-1] = OdUInt8(val))
855#define OD_BYTES_TO_BUFFPTR(pBuffPtr, FromBuff, nCount) (pBuffPtr+=nCount, ::memcpy(pBuffPtr-nCount, FromBuff, nCount))
861#ifdef TD_STRICT_ALIGNMENT
863#if defined(_WIN32_WCE) || defined FX_TOUCH_VERSION
864#define VISIBILITY_ATTR FIRSTDLL_EXPORT
865FIRSTDLL_EXPORT void *bsearch(
const void *key,
const void *base,
size_t numeles,
size_t widthele,
int(__cdecl *cfunc)(
const void *elem1,
const void *elem2));
867#define VISIBILITY_ATTR extern
870VISIBILITY_ATTR
double getStrictDouble(
OdUInt8** ppBuff);
871VISIBILITY_ATTR
void setStrictDouble(
OdUInt8** ppBuff,
double d);
872VISIBILITY_ATTR
void setStrictInt16(
OdUInt8** ppBuff,
OdInt16 val);
873VISIBILITY_ATTR
void setStrictInt32(
OdUInt8** ppBuff,
OdInt32 val);
874VISIBILITY_ATTR
void setStrictInt64(
OdUInt8** ppBuff,
OdInt64 val);
876#define OD_INT16_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 2, (OdInt16)( *(pBuffPtr - 2) \
877 | (*(pBuffPtr - 1) << 8)))
878#define OD_INT32_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 4, (OdInt32)( *(pBuffPtr - 4) \
879 | (*(pBuffPtr - 3) << 8) \
880 | (*(pBuffPtr - 2) << 16) \
881 | (*(pBuffPtr - 1) << 24)))
883#define OD_INT64_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 8, (OdInt64)( *(pBuffPtr - 8) \
884 | (OdInt64(*(pBuffPtr - 7)) << 8) \
885 | (OdInt64(*(pBuffPtr - 6)) << 16) \
886 | (OdInt64(*(pBuffPtr - 5)) << 24) \
887 | (OdInt64(*(pBuffPtr - 4)) << 32) \
888 | (OdInt64(*(pBuffPtr - 3)) << 40) \
889 | (OdInt64(*(pBuffPtr - 2)) << 48) \
890 | (OdInt64(*(pBuffPtr - 1)) << 56)))
892#define OD_DOUBLE_FROM_BUFFPTR(pBuffPtr) getStrictDouble(&pBuffPtr)
894#define OD_INT16_TO_BUFFPTR(pBuffPtr, val) setStrictInt16(&pBuffPtr, val)
895#define OD_INT32_TO_BUFFPTR(pBuffPtr, val) setStrictInt32(&pBuffPtr, val)
896#define OD_INT64_TO_BUFFPTR(pBuffPtr, val) setStrictInt64(&pBuffPtr, val)
898#define OD_DOUBLE_TO_BUFFPTR(pBuffPtr, val) setStrictDouble(&pBuffPtr, val)
903inline double getValidDouble(
OdUInt8** ppBuff)
905 double d = isValidNonZeroIEEEDouble(*ppBuff) ? *((
double*)(*ppBuff)) : 0.0;
910#define OD_INT16_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 2, *((OdInt16*)(pBuffPtr - 2)))
911#define OD_INT32_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 4, *((OdInt32*)(pBuffPtr - 4)))
912#define OD_INT64_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 8, *((OdInt64*)(pBuffPtr - 8)))
914#define OD_DOUBLE_FROM_BUFFPTR(pBuffPtr) getValidDouble(&pBuffPtr)
917#define OD_INT16_TO_BUFFPTR(pBuffPtr, val) (pBuffPtr+=2, *((OdInt16*)(pBuffPtr-2)) = OdInt16(val))
918#define OD_INT32_TO_BUFFPTR(pBuffPtr, val) (pBuffPtr+=4, *((OdInt32*)(pBuffPtr-4)) = OdInt32(val))
919#define OD_INT64_TO_BUFFPTR(pBuffPtr, val) (pBuffPtr+=8, *((OdInt64*)(pBuffPtr-8)) = OdInt64(val))
921#define OD_DOUBLE_TO_BUFFPTR(pBuffPtr, val) (pBuffPtr+=8, *((double*)(pBuffPtr-8)) = double(val))
930extern double getBeDouble(
OdUInt8** ppBuff);
935extern void setBeDouble(
OdUInt8** ppBuff,
double d);
943#define OD_INT16_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 2, (OdInt16)( *(pBuffPtr - 2) \
944 | (*(pBuffPtr - 1) << 8)))
945#define OD_INT32_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 4, (OdInt32)( *(pBuffPtr - 4) \
946 | (*(pBuffPtr - 3) << 8) \
947 | (*(pBuffPtr - 2) << 16) \
948 | (*(pBuffPtr - 1) << 24)))
949#define OD_INT64_FROM_BUFFPTR(pBuffPtr) (pBuffPtr += 8, (OdInt64)( *(pBuffPtr - 8) \
950 | (((OdInt64)(*(pBuffPtr - 7))) << 8) \
951 | (((OdInt64)(*(pBuffPtr - 6))) << 16) \
952 | (((OdInt64)(*(pBuffPtr - 5))) << 24) \
953 | (((OdInt64)(*(pBuffPtr - 4))) << 32) \
954 | (((OdInt64)(*(pBuffPtr - 3))) << 40) \
955 | (((OdInt64)(*(pBuffPtr - 2))) << 48) \
956 | (((OdInt64)(*(pBuffPtr - 1))) << 56)))
958#define OD_DOUBLE_FROM_BUFFPTR(pBuffPtr) getBeDouble(&pBuffPtr)
961#define OD_INT16_TO_BUFFPTR(pBuffPtr, val) setStrictInt16(&pBuffPtr, val)
962#define OD_INT32_TO_BUFFPTR(pBuffPtr, val) setStrictInt32(&pBuffPtr, val)
963#define OD_INT64_TO_BUFFPTR(pBuffPtr, val) setStrictInt64(&pBuffPtr, val)
965#define OD_DOUBLE_TO_BUFFPTR(pBuffPtr, val) setBeDouble(&pBuffPtr, val)
971#if defined(ODA_WINDOWS)
976#define ODCOLORREF OdUInt32
977#define ODRGB(r,g,b) ((ODCOLORREF)(((OdUInt8)(r)|((OdUInt16)((OdUInt8)(g))<<8))|(((OdUInt32)(OdUInt8)(b))<<16)))
978#define ODRGBA(r,g,b,a) (((ODCOLORREF)ODRGB(r,g,b))|(((OdUInt32)(OdUInt8)(a))<<24))
980#if defined(_WIN32) && !defined(WIN64) && !defined(_WINRT)
982#define ODGETRED(rgb) GetRValue(rgb)
983#define ODGETGREEN(rgb) GetGValue(rgb)
984#define ODGETBLUE(rgb) GetBValue(rgb)
985#define ODGETALPHA(rgba) ((BYTE)((rgba)>>24))
990#define ODGETRED(rgb) ((OdUInt8)(rgb))
991#define ODGETGREEN(rgb) ((OdUInt8)(((OdUInt16)(rgb)) >> 8))
992#define ODGETBLUE(rgb) ((OdUInt8)((rgb)>>16))
993#define ODGETALPHA(rgba) ((OdUInt8)((rgba)>>24))
995typedef struct OdTagRECT{
1002#if (!defined(WIN64) && !defined(ODA_WINDOWS_GCC)) || defined(_WINRT)
1005#ifndef RGBQUAD_DEFINED
1006#define RGBQUAD_DEFINED
1015 typedef struct tagRGBQUAD
1021} RGBQUAD, *LPRGBQUAD;
1029#ifndef BITMAPINFOHEADER_DEFINED
1030#define BITMAPINFOHEADER_DEFINED
1040typedef struct tagBITMAPINFOHEADER {
1052} BITMAPINFOHEADER, *PBITMAPINFOHEADER;
1057typedef struct tagCIEXYZ
1064typedef struct tagICEXYZTRIPLE
1071typedef struct tagBITMAPV4HEADER {
1088 CIEXYZTRIPLE bV4Endpoints;
1092} BITMAPV4HEADER, *PBITMAPV4HEADER;
1103#ifndef BITMAPINFO_DEFINED
1104#define BITMAPINFO_DEFINED
1105typedef struct tagBITMAPINFO {
1106 BITMAPINFOHEADER bmiHeader;
1107 RGBQUAD bmiColors[1];
1108} BITMAPINFO, *PBITMAPINFO;
1113#ifndef BITMAPFILEHEADER_DEFINED
1114#define BITMAPFILEHEADER_DEFINED
1123 typedef struct tagBITMAPFILEHEADER
1130} BITMAPFILEHEADER, *PBITMAPFILEHEADER;
1147#define ODTOCMCOLOR(colorref) OdCmEntityColor( ODGETRED(colorref), ODGETGREEN(colorref), ODGETBLUE(colorref) )
1148#define ODTOCOLORREF(cmColor) ODRGB( cmColor.red(), cmColor.green(), cmColor.blue() )
1155#if defined(_TOOLKIT_IN_DLL_) && defined(__GNUC__) && defined(__APPLE__)
1157#include <mach-o/dyld.h>
1160# define RTLD_LAZY 0x1
1163# define RTLD_NOW 0x2
1166# define RTLD_LOCAL 0x4
1169# define RTLD_GLOBAL 0x8
1172# define RTLD_NOLOAD 0x10
1174# ifndef RTLD_NODELETE
1175# define RTLD_NODELETE 0x80
1179void* LoadSharedLibrary(
const OdString& path,
int mode = 2);
1180void *GetFunction(
void *handle,
char *symbol);
1181bool FreeSharedLibrary(
void *handle);
1185#if defined(_TOOLKIT_IN_DLL_) && defined(__GNUC__) && !defined(__APPLE__)
1209FIRSTDLL_EXPORT inline void *Od_memmove(
void *dest,
const void *src,
size_t count) {
return memmove(dest, src,
count); };
GLuint GLsizei GLsizei GLint GLenum * type
GLint GLint GLint GLsizei GLsizei GLenum format