96 #ifndef _SIZE_T_DEFINED 97 #define _SIZE_T_DEFINED 98 #endif //_SIZE_T_DEFINED 107 #define _FX_WIN32_DESKTOP_ 1 110 #define _FX_WIN32_MOBILE_ 2 116 #define _FX_LINUX_DESKTOP_ 4 119 #define _FX_LINUX_EMBEDDED_ 5 121 #define _FX_SYMBIAN_ 6 124 #define _FX_MACOSX_ 7 127 #define _FX_EMBEDDED_ 8 129 #define _FX_SOLARIS_ 9 131 #define _FX_PALMOS_ 10 133 #define _FX_NETBSD_ 11 137 #define _FX_ANDROID_ 12 140 #define _FX_VXWORKS_ 13 147 #define _FXM_PLATFORM_WINDOWS_ 1 149 #define _FXM_PLATFORM_LINUX_ 2 151 #define _FXM_PLATFORM_APPLE_ 3 153 #define _FXM_PLATFORM_ANDROID_ 4 156 #define _CHROME_PNACL_ 159 #ifdef __EMSCRIPTEN__ 160 #define _FXM_PLATFORM_LINUX_JS_ 163 #if defined(_FXM_PLATFORM_LINUX_JS_) || defined(_CHROME_PNACL_) 164 #define _FX_OS_ _FX_LINUX_DESKTOP_ 165 #define _FXM_PLATFORM_ _FXM_PLATFORM_LINUX_ 171 #if defined(__SYMBIAN32__) || defined(__symbian__) 172 #define _FX_OS_ _FX_SYMBIAN_ 173 #elif defined(_WIN32_WCE) 174 #define _FX_OS_ _FX_WIN32_MOBILE_ 175 #define _FXM_PLATFORM_ _FXM_PLATFORM_WINDOWS_ 176 #if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) 177 #define UNSUPPORT_CPP0X 179 #elif defined(__linux__) || (defined(FOXIT_CHROME_BUILD) && defined(__native_client__)) 180 #if defined(__arm__) && (!defined(OS_CHROMEOS)) && (!defined(FOXIT_CHROME_BUILD)) 181 #define _FX_OS_ _FX_LINUX_EMBEDDED_ 183 #define _FX_OS_ _FX_LINUX_DESKTOP_ 185 #define _FXM_PLATFORM_ _FXM_PLATFORM_LINUX_ 186 #elif defined(__NetBSD__) 187 #define _FX_OS_ _FX_NETBSD_ 188 #elif defined(_WIN64) 189 #define _FX_OS_ _FX_WIN64_ 190 #define _FXM_PLATFORM_ _FXM_PLATFORM_WINDOWS_ 191 #elif defined(_WIN32) 192 #define _FX_OS_ _FX_WIN32_DESKTOP_ 193 #define _FXM_PLATFORM_ _FXM_PLATFORM_WINDOWS_ 194 #elif defined(__sparc__) 195 #define _FX_OS_ _FX_SOLARIS_ 196 #define _FXM_PLATFORM_ _FXM_PLATFORM_LINUX_ 197 #elif defined(__ARMCC_VERSION) || defined(__ICCARM__) || defined(__TMS470__) 198 #define _FX_OS_ _FX_EMBEDDED_ 199 #elif defined(__APPLE__) 200 #include "TargetConditionals.h" 201 #if (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1) || (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR == 1) 202 #define _FX_OS_ _FX_IOS_ 204 #define _FX_OS_ _FX_MACOSX_ 206 #define _FXM_PLATFORM_ _FXM_PLATFORM_APPLE_ 207 #elif defined(__ARM_EABI__) 208 #define _FX_OS_ _FX_EMBEDDED_ 211 #if _FX_OS_ == _FX_ANDROID_ 212 #ifndef _FXM_PLATFORM_ 213 #define _FXM_PLATFORM_ _FXM_PLATFORM_ANDROID_ 215 #elif (_FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_ || _FX_OS_ == _FX_WIN32_DESKTOP_) 216 #ifndef _FXM_PLATFORM_ 217 #define _FXM_PLATFORM_ _FXM_PLATFORM_WINDOWS_ 219 #elif (_FX_OS_ == _FX_IOS_ || _FX_OS_ == _FX_MACOSX_) 220 #ifndef _FXM_PLATFORM_ 221 #define _FXM_PLATFORM_ _FXM_PLATFORM_APPLE_ 223 #elif _FX_OS_ == _FX_SOLARIS_ || _FX_OS_ == _FX_LINUX_EMBEDDED_ || _FX_OS_ == _FX_LINUX_DESKTOP_ 224 #ifndef _FXM_PLATFORM_ 225 #define _FXM_PLATFORM_ _FXM_PLATFORM_LINUX_ 230 #if !defined(_FX_OS_) || _FX_OS_ == 0 231 #error Sorry, can not figure out what OS you are targeting to. Please specify _FX_OS_ macro. 235 #if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_) && !defined(_FX_NO_WINDOWS_) 237 #define _CRT_SECURE_NO_WARNINGS 238 #if defined(_MSC_VER) && _MSC_VER < 1300 239 #define _WIN32_WINNT 0x400 241 #if defined(_MSC_VER) && _MSC_VER < 1600 242 #define UNSUPPORT_CPP0X 247 #if (0x00000001 == WINAPI_PARTITION_DESKTOP) && (0x00000002 == WINAPI_PARTITION_APP) //Macros in Windows Kit/8 249 #else //Macros in Windows Kit/8.1 251 #endif //(0x00000001 == WINAPI_PARTITION_DESKTOP) && (0x00000002 == WINAPI_PARTITION_APP) 254 #if ((WINAPI_FAMILY&WINAPI_PARTITION_APP) == WINAPI_PARTITION_APP) 256 #define _FX_WINAPI_PARTITION_APP_ 258 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY&WINAPI_PARTITION_DESKTOP) == WINAPI_PARTITION_DESKTOP) 260 #define _FX_WINAPI_PARTITION_DESKTOP_ 266 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PC_APP) 268 #define _FX_WINAPI_PARTITION_APP_ 271 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PC_APP) 273 #define _FX_WINAPI_PARTITION_PHONE_APP_ 276 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 278 #define _FX_WINAPI_PARTITION_DESKTOP_ 281 #else // !defined(WINAPI_FAMILY) 283 #define _FX_WINAPI_PARTITION_DESKTOP_ 285 #endif //WINAPI_FAMILY 286 #endif //(_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_) && !defined(_FX_NO_WINDOWS_) 311 #define _FX_NOKIA_X86_ 8 313 #define _FX_METROWERKS_ 9 317 #define _FX_TMS470_ 11 319 #define _FX_MIPS_SDE_ 12 322 #ifndef _FX_COMPILER_ 325 #define _FX_COMPILER_ _FX_VC8_ 326 #elif _MSC_VER >= 1300 327 #define _FX_COMPILER_ _FX_VC7_ 348 #define _FX_COMPILER_ _FX_VC6_ 350 #elif defined(__GNUC__) 351 #define _FX_COMPILER_ _FX_GCC_ 352 #elif defined(__ARMCC_VERSION) 353 #if __ARMCC_VERSION < 200000 354 #define _FX_COMPILER_ _FX_ADS_ 356 #define _FX_COMPILER_ _FX_RVCT_ 358 #elif defined(__ICCARM__) 359 #define _FX_COMPILER_ _FX_IARCC_ 360 #elif defined(_PACC_VER) 361 #define _FX_COMPILER_ _FX_PACC_ 362 #elif defined(__TMS470__) 363 #define _FX_COMPILER_ _FX_TMS470_ 366 #if !defined(_FX_COMPILER_) || _FX_COMPILER_ == 0 367 #error Sorry, can not figure out what compiler you are using. Please specify _FX_COMPILER_ macro. 383 #define _FX_POWERPC_ 3 395 #if defined(_FXM_PLATFORM_LINUX_JS_) 396 #define _FX_CPU_ _FX_X64_ 399 #if defined(_CHROME_PNACL_) 400 #define _FX_CPU_ _FX_X86_ 404 #if defined(__arm__) || defined(ARM) || defined(_ARM_) || defined(__ARMCC_VERSION) || defined(__ICCARM__) || defined(__arm) || defined(arm9) 405 #define _FX_CPU_ _FX_ARM_ 406 #elif defined(__arm64) || defined(__arm64__) || defined(__aarch64__) 407 #define _FX_CPU_ _FX_ARM64_ 408 #elif defined(_M_IX86) || defined(__i386__) 424 #define _FX_CPU_ _FX_X86_ 425 #elif defined(_M_X64) || defined(__x86_64__) 426 #define _FX_CPU_ _FX_X64_ 427 #elif defined(_M_IA64) 428 #define _FX_CPU_ _FX_IA64_ 429 #elif defined(__POWERPC__) 430 #define _FX_CPU_ _FX_POWERPC_ 431 #elif defined(__sparc__) 432 #define _FX_CPU_ _FX_SPARC_ 433 #elif defined(MIPS) || defined(_MIPS_) || defined(__mips) 434 #define _FX_CPU_ _FX_MIPS_ 437 #if !defined(_FX_CPU_) || _FX_CPU_ == 0 438 #error Sorry, can not figure out what CPU you are targeting to. Please specify _FX_CPU_ macro. 445 #define _FX_EMBEDFONT_PRINT_ 461 #ifndef _FX_WORDSIZE_ 462 #if defined(_WIN64) || defined(__arm64) || defined(__arm64__) || defined(_M_AMD64) || defined(_M_X64) || defined(_M_IA64) || defined(__powerpc64__) || defined(__x86_64__) || __WORDSIZE == 64 || defined(__LP64__) 463 #define _FX_WORDSIZE_ _FX_W64_ 465 #define _FX_WORDSIZE_ _FX_W32_ 478 #define _FX_BIG_ENDIAN_ 1 480 #define _FX_LITTLE_ENDIAN_ 2 484 #if _FX_CPU_ == _FX_POWERPC_ || _FX_CPU_ == _FX_SPARC_ 485 #define _FX_ENDIAN_ _FX_BIG_ENDIAN_ 496 #define _FX_ENDIAN_ _FX_LITTLE_ENDIAN_ 509 #ifndef _FX_NO_ANSIC_ 514 #if _FX_OS_ != _FX_VXWORKS_ && ((_FX_COMPILER_ == _FX_GCC_ && _FX_OS_ != _FX_SYMBIAN_) || _FX_COMPILER_ == _FX_NOKIA_X86_ || _FX_COMPILER_ == _FX_METROWERKS_ || _FX_COMPILER_ == _FX_IARCC_) 521 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ 522 #include <libkern/OSAtomic.h> 523 #if _FX_OS_ == _FX_MACOSX_ 524 #include <Carbon/Carbon.h> 525 #elif _FX_OS_ == _FX_IOS_ 526 #include <CoreText/CoreText.h> 527 #include <CoreGraphics/CoreGraphics.h> 533 #define GetObject GetObjectW 534 #define GetModuleFileName GetModuleFileNameW 535 #define GetFullPathName GetFullPathNameW 541 #define GetObject GetObjectA 547 #define GetModuleFileName GetModuleFileNameA 553 #define GetFullPathName GetFullPathNameA 556 #if ( _FX_OS_ == _FX_IOS_ && (_FX_CPU_ == _FX_ARM_ || _FX_CPU_ == _FX_ARM64_)) || (_FX_OS_ == _FX_ANDROID_) || (_FX_OS_ == _FX_WIN32_MOBILE_) 557 #ifndef _FXCORE_LIMITED_MEMORY_ 558 #define _FXCORE_LIMITED_MEMORY_ 560 #ifndef _FXCORE_LIMITED_CPU_ 561 #define _FXCORE_LIMITED_CPU_ 565 #if _FX_COMPILER_ == _FX_ADS_ || _FX_COMPILER_ == _FX_RVCT_ || _FX_COMPILER_ == _FX_TMS470_ || _FX_OS_ == _FX_ANDROID_ 567 #define _FX_NO_NAMESPACE_ 576 #define _FX_DEFAULT_TARGET_ 0 583 #if (((_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_) && (defined(_FX_WINAPI_PARTITION_DESKTOP_) || defined(_FX_WINAPI_PARTITION_APP_))) || _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_MACOSX_) 585 #if !defined(_FXM_PLATFORM_LINUX_JS_) && !defined(_CHROME_PNACL_) && (_FX_CPU_ != _FX_ARM_) && (_FX_CPU_ != _FX_ARM64_) 590 #if _FX_OS_ != _FX_MACOSX_ 594 #ifndef _FX_NO_OPENSSL_ 595 #define _FX_NO_OPENSSL_ 598 #if (((_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_) && defined(_FX_WINAPI_PARTITION_DESKTOP_)) || _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_MACOSX_) 599 #ifndef _FX_NO_JPEG_TURBO_ 600 #if !defined(_FXM_PLATFORM_LINUX_JS_) && !defined(_CHROME_PNACL_) 601 #define _FX_JPEG_TURBO_ 604 #ifndef _FX_NO_OPENSSL_ 605 #define _FXM_OPENSSL_ 607 #define _FX_LARGEFILE_SUPPORT_ 611 #define _FPDF_STREAM_RENDER_ 612 #ifndef _FX_ENABLE_OVERPRINT_ 613 #define _FX_ENABLE_OVERPRINT_ 617 #ifdef _FX_WINAPI_PARTITION_APP_ 618 #define _FPDF_STREAM_RENDER_ 670 #define FX_SUCCEEDED(Status) ((FX_ERR)(Status) >= 0) 672 #define FX_FAILED(Status) ((FX_ERR)(Status) < 0) 691 #if !defined(_MSC_VER) && (_FX_CPU_ == _FX_X64_ || _FX_CPU_ == _FX_IA64_ || _FX_CPU_ == _FX_ARM64_) 703 #ifdef _NATIVE_WCHAR_T_DEFINED 717 typedef __int64 FX_INT64;
719 typedef unsigned __int64 FX_UINT64;
721 typedef long long int FX_INT64;
722 typedef unsigned long long FX_UINT64;
725 #if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_) && !defined(_FX_NO_WINDOWS_) 731 #if (_FX_CPU_ == _FX_X64_ || _FX_CPU_ == _FX_IA64_ || _FX_CPU_ == _FX_ARM64_) 749 #define FX_DEFINEHANDLE(name) typedef struct _##name {FX_LPVOID pData;} * name; 751 #if defined(DEBUG) && !defined(_DEBUG) 774 #if !defined(_FX_NO_ANSIC_) 779 #define FXSYS_assert assert 788 #define ASSERT FXSYS_assert 799 #define FX_MAX(a, b) (((a) > (b)) ? (a) : (b)) 801 #define FX_MIN(a, b) (((a) < (b)) ? (a) : (b)) 804 #define FX_PI 3.1415926535897932384626433832795f 807 #if _FX_WORDSIZE_ == _FX_W64_ && _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 808 #define _FX_CRT_MALLOC_LIMIT_ 0x7fffffffffffffffL 810 #define _FX_CRT_MALLOC_LIMIT_ 0x7fffffffL 823 #if !defined(_FX_NO_ANSIC_) 828 #define FXSYS_sprintf sprintf 834 #define FXSYS_snprintf _snprintf 835 #define FXSYS_vsnprintf _vsnprintf 837 #define FXSYS_snprintf snprintf 838 #define FXSYS_vsnprintf vsnprintf 844 #define FXSYS_vsprintf vsprintf 849 #define FXSYS_strchr strchr 854 #define FXSYS_strlen strlen 859 #define FXSYS_strncmp strncmp 864 #define FXSYS_strcmp strcmp 869 #define FXSYS_strcpy strcpy 874 #define FXSYS_strncpy strncpy 879 #define FXSYS_strstr strstr 882 int FXSYS_vsprintf(
char *buffer,
const char *format, va_list args);
885 int FXSYS_strncmp(
const char* str1,
const char* str2,
size_t len);
888 char*
FXSYS_strncpy(
char* dest,
const char* src,
size_t len);
889 char*
FXSYS_strstr(
const char *
string,
const char *strFind);
900 #if !defined(_FX_NO_ANSIC_) 905 #define FXSYS_FILE FILE 910 #define FXSYS_fopen fopen 915 #define FXSYS_fclose fclose 920 #define FXSYS_SEEK_END SEEK_END 925 #define FXSYS_SEEK_SET SEEK_SET 930 #define FXSYS_fseek fseek 935 #define FXSYS_ftell ftell 940 #define FXSYS_fread fread 945 #define FXSYS_fwrite fwrite 950 #define FXSYS_fprintf fprintf 955 #define FXSYS_fflush fflush 957 #define FXSYS_FILE void 960 #define FXSYS_SEEK_END 2 961 #define FXSYS_SEEK_SET 0 971 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_ 976 #ifdef _NATIVE_WCHAR_T_DEFINED 977 #define FXSYS_wfopen(f, m) _wfopen((const wchar_t*)(f), (const wchar_t*)(m)) 979 #define FXSYS_wfopen _wfopen 994 #if _FX_OS_ != _FX_VXWORKS_ && _FX_OS_ != _FX_ANDROID_ && !defined(_FX_NO_ANSIC_) && _FX_COMPILER_ != _FX_ADS_ && _FX_COMPILER_ != _FX_RVCT_ && _FX_COMPILER_ != _FX_PACC_ && _FX_COMPILER_ != _FX_TMS470_ && _FX_COMPILER_ != _FX_MIPS_SDE_ 995 #ifdef _NATIVE_WCHAR_T_DEFINED 996 #define FXSYS_wcslen(str) wcslen((wchar_t*)(str)) 997 #define FXSYS_wcscmp(str1, str2) wcscmp((wchar_t*)(str1), (wchar_t*)(str2)) 1003 #define FXSYS_wcslen wcslen 1008 #define FXSYS_wcscmp wcscmp 1016 #if _FX_OS_ != _FX_VXWORKS_ && _FX_OS_ != _FX_ANDROID_ && !defined(_FX_NO_ANSIC_) && _FX_COMPILER_ != _FX_ADS_ && _FX_COMPILER_ != _FX_RVCT_ && !(_FX_COMPILER_ == _FX_GCC_ && _FX_OS_ == _FX_SYMBIAN_) && _FX_COMPILER_ != _FX_PACC_ && _FX_COMPILER_ != _FX_TMS470_ && _FX_COMPILER_ != _FX_MIPS_SDE_ 1017 #ifdef _NATIVE_WCHAR_T_DEFINED 1018 #define FXSYS_wcschr(str, ch) (FX_LPCWSTR)wcschr((wchar_t*)(str), ch) 1019 #define FXSYS_wcsstr(str1, str2) (FX_LPCWSTR)wcsstr((wchar_t*)(str1), (wchar_t*)(str2)) 1020 #define FXSYS_wcsncmp(str1, str2, n) wcsncmp((wchar_t*)(str1), (wchar_t*)(str2), n) 1026 #define FXSYS_wcschr wcschr 1031 #define FXSYS_wcsstr wcsstr 1036 #define FXSYS_wcsncmp wcsncmp 1042 #define FXSYS_vswprintf vswprintf 1047 #if _FX_OS_ != _FX_ANDROID_ 1050 #define FXSYS_vswprintf vswprintf 1054 #if !defined(_FX_NO_ANSIC_) && _FX_COMPILER_ != _FX_TMS470_ 1059 #define FXSYS_mbstowcs mbstowcs 1064 #define FXSYS_wcstombs wcstombs 1079 #if !defined(_FX_NO_ANSIC_) 1084 #define FXSYS_memcmp memcmp 1089 #define FXSYS_memcpy memcpy 1096 #define FXSYS_memmove memmove 1101 #define FXSYS_memset memset 1106 #define FXSYS_memchr memchr 1118 #if !defined(_FX_NO_ANSIC_) 1123 #define FXSYS_qsort qsort 1125 void FXSYS_qsort(
void*,
unsigned,
unsigned,
int (*)(
const void*,
const void*));
1128 #if _FX_OS_ != _FX_WIN32_MOBILE_ && !defined(_FX_NO_ANSIC_) && _FX_OS_ != _FX_SYMBIAN_ 1133 #define FXSYS_bsearch bsearch 1136 void *
FXSYS_bsearch(
const void *key,
const void *base,
size_t num,
size_t width,
int (*compare)(
const void *,
const void *));
1139 #if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_) && !defined(_FX_NO_WINDOWS_) 1146 #define FXSYS_itoa _itoa 1151 #define FXSYS_strlwr _strlwr 1156 #define FXSYS_strupr _strupr 1161 #define FXSYS_stricmp _stricmp 1163 #ifdef _NATIVE_WCHAR_T_DEFINED 1164 #define FXSYS_wcsicmp(str1, str2) _wcsicmp((wchar_t*)(str1), (wchar_t*)(str2)) 1165 #define FXSYS_WideCharToMultiByte(p1, p2, p3, p4, p5, p6, p7, p8) WideCharToMultiByte(p1, p2, (const wchar_t*)(p3), p4, p5, p6, p7, p8) 1166 #define FXSYS_MultiByteToWideChar(p1, p2, p3, p4, p5, p6) MultiByteToWideChar(p1, p2, p3, p4, (wchar_t*)(p5), p6) 1167 #define FXSYS_wcslwr(str) _wcslwr((wchar_t*)(str)) 1168 #define FXSYS_wcsupr(str) _wcsupr((wchar_t*)(str)) 1174 #define FXSYS_wcsicmp _wcsicmp 1179 #define FXSYS_WideCharToMultiByte WideCharToMultiByte 1184 #define FXSYS_MultiByteToWideChar MultiByteToWideChar 1189 #define FXSYS_wcslwr _wcslwr 1194 #define FXSYS_wcsupr _wcsupr 1197 #ifndef _FX_WINAPI_PARTITION_DESKTOP_ 1207 #define FXSYS_GetFullPathName GetFullPathName 1212 #define FXSYS_GetModuleFileName GetModuleFileName 1217 #define FXSYS_GetACP GetACP 1220 char*
FXSYS_itoa(
int value,
char*
string,
int radix);
1223 char* buf,
int buflen,
const char* default_str,
int* pUseDefault);
1225 wchar_t* buf,
int buflen);
1232 int FXSYS_wcsicmp(
const wchar_t *string1,
const wchar_t *string2);
1330 #if _FX_OS_ == _FX_PALMOS_ && _FX_COMPILER_ == _FX_METROWERKS_ 1336 extern double __ieee754_pow(
double,
double);
1337 extern double __ieee754_sqrt(
double);
1338 extern double __fabs(
double);
1339 extern double __ieee754_atan2(
double,
double);
1340 extern double __ceil(
double);
1341 extern double __floor(
double);
1342 extern double __cos(
double);
1343 extern double __ieee754_acos(
double);
1344 extern double __sin(
double);
1345 extern double __ieee754_log(
double);
1346 extern double __ieee754_log10(
double);
1348 #define FXSYS_pow(x, y) __ieee754_pow(x, y) 1349 #define FXSYS_sqrt(x) __ieee754_sqrt(x) 1350 #define FXSYS_fabs(x) __fabs(x) 1351 #define FXSYS_atan2(x, y) __ieee754_atan2(x, y) 1352 #define FXSYS_ceil(x) __ceil(x) 1353 #define FXSYS_floor(x) __floor(x) 1354 #define FXSYS_cos(x) __cos(x) 1355 #define FXSYS_acos(x) __ieee754_acos(x) 1356 #define FXSYS_sin(x) __sin(x) 1357 #define FXSYS_log(x) __ieee754_log(x) 1358 #define FXSYS_log10(x) __ieee754_log10(x) 1365 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ || _FX_OS_ == _FX_LINUX_DESKTOP_ 1370 #define FXSYS_pow powf 1375 #define FXSYS_sqrt sqrtf 1380 #define FXSYS_fabs fabsf 1385 #define FXSYS_atan2 atan2f 1390 #define FXSYS_ceil ceilf 1395 #define FXSYS_floor floorf 1400 #define FXSYS_cos cosf 1405 #define FXSYS_acos acosf 1410 #define FXSYS_sin sinf 1415 #define FXSYS_log logf 1420 #define FXSYS_log10 log10f 1425 #define FXSYS_fmod fmodf 1427 #define FXSYS_pow(a, b) (FX_FLOAT)pow(a, b) 1428 #define FXSYS_sqrt(a) (FX_FLOAT)sqrt(a) 1429 #define FXSYS_fabs(a) (FX_FLOAT)fabs(a) 1430 #define FXSYS_atan2(a, b) (FX_FLOAT)atan2(a, b) 1431 #define FXSYS_ceil(a) (FX_FLOAT)ceil(a) 1432 #define FXSYS_floor(a) (FX_FLOAT)floor(a) 1433 #define FXSYS_cos(a) (FX_FLOAT)cos(a) 1434 #define FXSYS_acos(a) (FX_FLOAT)acos(a) 1435 #define FXSYS_sin(a) (FX_FLOAT)sin(a) 1436 #define FXSYS_log(a) (FX_FLOAT)log(a) 1437 #define FXSYS_log10(a) (FX_FLOAT)log10(a) 1438 #define FXSYS_fmod(a, b) (FX_FLOAT)fmod(a, b) 1442 #if !defined(_FX_NO_ANSIC_) 1447 #define FXSYS_abs abs 1449 #define FXSYS_abs(a) ((a)<0?-(a):(a)) 1462 #ifdef _FX_NO_GLOBAL_ 1465 void FXSYS_SetStaticPointer1(
void*);
1467 void* FXSYS_GetStaticPointer1(
void);
1469 void FXSYS_SetStaticPointer2(
void*);
1471 void* FXSYS_GetStaticPointer2(
void);
1475 #if _FX_ENDIAN_ == _FX_BIG_ENDIAN_ 1476 #define _FX_MSB_FIRST_ 1477 #define FXDWORD_FROM_LSBFIRST(i) ( ((FX_BYTE)(i) << 24) | ((FX_BYTE)((i) >> 8) << 16) | ((FX_BYTE)((i) >> 16) << 8) | (FX_BYTE)((i) >> 24) ) 1478 #define FXDWORD_FROM_MSBFIRST(i) (i) 1480 #define _FX_LSB_FIRST_ 1481 #define FXDWORD_FROM_LSBFIRST(i) (i) 1482 #define FXDWORD_FROM_MSBFIRST(i) ( ((FX_BYTE)(i) << 24) | ((FX_BYTE)((i) >> 8) << 16) | ((FX_BYTE)((i) >> 16) << 8) | (FX_BYTE)((i) >> 24) ) 1485 #if _FX_CPU_ == _FX_X86_ || _FX_CPU_ == _FX_X64_ || _FX_CPU_ == _FX_ARM64_ 1486 #define FXDWORD_GET_LSBFIRST(p) (*(FX_DWORD*)(p)) 1488 #define FXDWORD_GET_LSBFIRST(p) ((((FX_LPBYTE)(p))[3] << 24) | (((FX_LPBYTE)(p))[2] << 16) | (((FX_LPBYTE)(p))[1] << 8) | (((FX_LPBYTE)(p))[0])) 1491 #define FXDWORD_GET_MSBFIRST(p) ((((FX_LPBYTE)(p))[0] << 24) | (((FX_LPBYTE)(p))[1] << 16) | (((FX_LPBYTE)(p))[2] << 8) | (((FX_LPBYTE)(p))[3])) 1493 #define FXSYS_HIBYTE(word) ((FX_BYTE)((word) >> 8)) 1494 #define FXSYS_LOBYTE(word) ((FX_BYTE)(word)) 1495 #define FXSYS_HIWORD(dword) ((FX_WORD)((dword) >> 16)) 1496 #define FXSYS_LOWORD(dword) ((FX_WORD)(dword)) 1499 #define FXSYS_strtol strtol 1562 #define FXSYS_Mul(a, b) ((a) * (b)) 1564 #define FXSYS_Div(a, b) ((a) / (b)) 1566 #define FXSYS_MulDiv(a, b, c) ((a) * (b) / (c)) 1568 #define FXSYS_sqrt2(a, b) (FX_FLOAT)FXSYS_sqrt((a)*(a) + (b)*(b)) 1574 #if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_) && !defined(_FX_NO_WINDOWS_) 1577 #elif _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_LINUX_EMBEDDED_ || _FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_ || _FX_OS_ == _FX_ANDROID_ 1578 #include <pthread.h> 1580 #if _FX_OS_ == _FX_ANDROID_ 1583 typedef pthread_rwlock_t FX_RWLOCK;
1596 #define FX_CRITICAL_SECTION FX_MUTEX 1597 #define FX_InitializeCriticalSection(a) FX_Mutex_Initialize(a) 1598 #define FX_DeleteCriticalSection(a) FX_Mutex_Destroy(a) 1599 #define FX_TryEnterCriticalSection(a) FX_Mutex_TryLock(a) 1600 #define FX_EnterCriticalSection(a) FX_Mutex_Lock(a) 1601 #define FX_LeaveCriticalSection(a) FX_Mutex_Unlock(a) 1604 #if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_) && !defined(_FX_NO_WINDOWS_) 1606 #elif _FX_OS_ == _FX_LINUX_DESKTOP_ 1607 #ifdef _FX_SPINLOCK_USEGCCCAS_ 1610 #ifndef _CHROME_PNACL_ 1616 #elif _FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_ 1618 #else // android/embeded linux/other os 1629 #if _FX_OS_ == _FX_PALMOS_ && _FX_COMPILER_ == _FX_PACC_ 1630 #include <errtrycatch.h> 1631 #define setjmp ErrSetJump 1632 #define longjmp ErrLongJump 1633 #define jmp_buf ErrJumpBuf 1638 #if _FX_OS_ == _FX_MACOSX_ 1639 #include <Carbon/Carbon.h> 1640 #elif _FX_OS_ == _FX_IOS_ 1641 #include <CoreText/CoreText.h> 1642 #include <CoreGraphics/CoreGraphics.h> void * FXSYS_memset8(void *dst, FX_BYTE v, size_t size)
Set buffer data to specified value.
FX_BOOL FX_Mutex_TryLock(FX_MUTEX *pMutex)
Try to lock a mutex.
void * FX_LPVOID
Pointer to any type.
Definition: fx_system.h:633
FX_BOOL FX_Mutex_Initialize(FX_MUTEX *pMutex)
Initialize a mutex.
wchar_t FX_WCHAR
Compiler dependant Unicode character (16-bit for Microsoft Compiler, 32-bit for gcc).
Definition: fx_system.h:708
#define FXSYS_wcslwr
Convert a wide-character string to lowercase.
Definition: fx_system.h:1189
unsigned long FX_DWORD
32-bit unsigned integer.
Definition: fx_system.h:698
#define FXSYS_mbstowcs
Converts a sequence of multi-byte characters to a corresponding sequence of wide characters.
Definition: fx_system.h:1059
FX_LPCWSTR FXSYS_i64tow(FX_INT64 value, FX_LPWSTR str, int radix)
Convert an integer to an wide string.
#define FXSYS_fwrite
Writes data to a file.
Definition: fx_system.h:945
#define FXSYS_fprintf
Print formatted data to a file.
Definition: fx_system.h:950
FX_LPCSTR FXSYS_i64toa(FX_INT64 value, FX_LPSTR str, int radix)
Convert an integer to an ANSI string.
#define FXSYS_wcsncmp
Compare characters of two wide-character strings.
Definition: fx_system.h:1036
#define FXSYS_FILE
File structure.
Definition: fx_system.h:905
void const * FX_LPCVOID
Pointer to any constant type.
Definition: fx_system.h:635
int FXSYS_round(FX_FLOAT f)
Get nearest integer.
#define FXSYS_strcpy
Copy an ANSIC string.
Definition: fx_system.h:869
#define FXSYS_fflush
Flush file.
Definition: fx_system.h:955
FX_DWORD FX_UINT32
unsigned 32bits integer.
Definition: fx_system.h:744
wchar_t const * FX_LPCWSTR
Pointer to constant Unicode characters.
Definition: fx_system.h:712
#define FXSYS_GetFullPathName
Get the full path and file name of a specified file.
Definition: fx_system.h:1207
#define FXSYS_strlen
Get the length of a ANSIC string.
Definition: fx_system.h:854
#define FXSYS_wcsupr
Convert a wide-character string to uppercase.
Definition: fx_system.h:1194
#define FXSYS_strncpy
Copy an ANSIC string with length limitation.
Definition: fx_system.h:874
#define FXSYS_wcschr
Find a wide-character in a wide-character string.
Definition: fx_system.h:1026
FX_INT32 FXSYS_memcmp32(const void *buf1, const void *buf2, size_t size)
Compare data in two buffers.
char * FX_LPSTR
Pointer to 8-bit Windows (ANSI) characters.
Definition: fx_system.h:677
#define FXSYS_wfopen
Open a file using wide-string parameters. Only supported on Windows platforms now.
Definition: fx_system.h:979
#define FXSYS_memmove
Moves one buffer to another. If some regions of the source area and the destination overlap,...
Definition: fx_system.h:1096
CRITICAL_SECTION FX_MUTEX
Definition for mutex/critical section and read-write lock.
Definition: fx_system.h:1575
#define FXSYS_memcpy
Copy from one buffer to another.
Definition: fx_system.h:1089
void * FX_POSITION
A value used to denote the position of an element in a collection.
Definition: fx_system.h:637
#define FXSYS_vswprintf
Write formatted output wide character string using a pointer to a list of arguments.
Definition: fx_system.h:1042
#define FXSYS_itoa
Convert an integer to a ANSIC string.
Definition: fx_system.h:1146
FX_INT64 FXSYS_atoi64(FX_LPCSTR str)
Convert an ANSI string to an integer.
#define FXSYS_strchr
Find a character in a ANSIC string.
Definition: fx_system.h:849
#define FXSYS_strlwr
Convert a ANSIC string to lowercase.
Definition: fx_system.h:1151
int FX_INT32
32-bit signed integer.
Definition: fx_system.h:662
#define FXSYS_GetModuleFileName
Get the fully-qualified path for specified module.
Definition: fx_system.h:1212
void * FXSYS_memset32(void *dst, FX_INT32 v, size_t size)
Set buffer data to specified value.
#define FXSYS_memcmp
Compares two buffers.
Definition: fx_system.h:1084
int FX_BOOL
Boolean variable (should be TRUE or FALSE).
Definition: fx_system.h:666
unsigned short * FX_LPWORD
Pointer to a WORD.
Definition: fx_system.h:658
#define FXSYS_fseek
Moves the file pointer to a specified location.
Definition: fx_system.h:930
char const * FX_LPCSTR
Pointer to constant 8-bit Windows (ANSI) characters.
Definition: fx_system.h:679
#define FXSYS_wcslen
Get the length of a wide-character string.
Definition: fx_system.h:1003
FX_INT64 FXSYS_wtoi64(FX_LPCWSTR str)
Convert a wide string to an integer.
signed char FX_INT8
Signed 8bits integer.
Definition: fx_system.h:640
#define FXSYS_wcscmp
Compare wide-character strings.
Definition: fx_system.h:1008
#define FXSYS_GetACP
Retrieve the current ANSI code-page identifier for the system.
Definition: fx_system.h:1217
FX_INT32 FXSYS_wtoi(FX_LPCWSTR str)
Convert a wide string to an integer.
#define FXSYS_fread
Reads data from a file.
Definition: fx_system.h:940
UINT_PTR FX_UINTPTR
Unsigned integral type for pointer precision.
Definition: fx_system.h:729
#define FXSYS_qsort
Performs a quick sort. A generic algorithm.
Definition: fx_system.h:1123
#define FXSYS_wcsicmp
Compare two wide character strings. case-insensitive.
Definition: fx_system.h:1174
void * FX_SPINLOCK
Definition for spinlock.
Definition: fx_system.h:1605
unsigned long * FX_LPDWORD
Pointer to a DWORD.
Definition: fx_system.h:700
short FX_SHORT
Short integer (16 bits).
Definition: fx_system.h:654
#define FXSYS_fopen
Open a file.
Definition: fx_system.h:910
#define FXSYS_bsearch
Performs a binary search of a sorted array. A generic algorithm.
Definition: fx_system.h:1133
#define FXSYS_MultiByteToWideChar
Maps a character string to a wide-character string.
Definition: fx_system.h:1184
void FX_Mutex_Destroy(FX_MUTEX *pMutex)
Destroy a mutex.
unsigned char * FX_LPBYTE
Pointer to a FX_BYTE.
Definition: fx_system.h:646
#define FXSYS_strstr
Find a substring.
Definition: fx_system.h:879
#define FXSYS_wcsstr
Find a sub-wide-character-string.
Definition: fx_system.h:1031
char FX_CHAR
8-bit Windows (ANSI) character.
Definition: fx_system.h:675
float FX_FLOAT
32-bit floating-point number.
Definition: fx_system.h:664
#define FXSYS_assert
Assertion.
Definition: fx_system.h:779
unsigned short FX_UINT16
Unsigned 16bits integer.
Definition: fx_system.h:652
#define FXSYS_memchr
Search for a byte in a memory block.
Definition: fx_system.h:1106
#define FXSYS_strcmp
Compare ANSIC strings.
Definition: fx_system.h:864
#define FXSYS_WideCharToMultiByte
Maps a wide-character string to a character string.
Definition: fx_system.h:1179
Definition: fx_coordinates.h:458
unsigned char FX_UINT8
Unsigned 8bits integer.
Definition: fx_system.h:642
unsigned short const * FX_LPCWORD
Pointer to a WORD.
Definition: fx_system.h:660
#define FXSYS_fclose
Close a file.
Definition: fx_system.h:915
void FX_Mutex_Unlock(FX_MUTEX *pMutex)
Unlock a mutex.
#define FXSYS_ftell
Gets the current position of a file pointer.
Definition: fx_system.h:935
#define FXSYS_stricmp
Compare two ANSIC strings. case-insensitive.
Definition: fx_system.h:1161
#define FXSYS_strncmp
Compare characters of two ANSIC strings.
Definition: fx_system.h:859
void FX_Mutex_Lock(FX_MUTEX *pMutex)
Lock a mutex.
unsigned short FX_WORD
16-bit unsigned integer.
Definition: fx_system.h:656
short FX_INT16
Signed 16bits integer.
Definition: fx_system.h:650
#define FXSYS_memset
Use given character to initialize the buffer.
Definition: fx_system.h:1101
FX_INT32 FXSYS_atoi(FX_LPCSTR str)
Convert an ANSI string to an integer.
unsigned char const * FX_LPCBYTE
Pointer to a constant FX_BYTE.
Definition: fx_system.h:648
wchar_t * FX_LPWSTR
Pointer to Unicode characters.
Definition: fx_system.h:710
#define FXSYS_sprintf
Write formatted data to a ANSIC string.
Definition: fx_system.h:828
#define FX_DEFINEHANDLE(name)
Macro to define a handle type.
Definition: fx_system.h:749
#define FXSYS_wcstombs
Converts a sequence of wide characters to a corresponding sequence of multi-byte characters.
Definition: fx_system.h:1064
#define FXSYS_vsprintf
Write formatted output using a pointer to a list of arguments.
Definition: fx_system.h:844
void * FXSYS_memmove32(void *dst, const void *src, size_t size)
Move source buffer data into destination.
#define FXSYS_strupr
Convert a ANSIC string to uppercase.
Definition: fx_system.h:1156
void * FXSYS_memcpy32(void *dst, const void *src, size_t size)
Copy buffer data from source to destination.
FX_UINT64 FX_QWORD
unsigned quad-word integer.
Definition: fx_system.h:746
INT_PTR FX_INTPTR
Signed integral type for pointer precision.
Definition: fx_system.h:727
unsigned char FX_BYTE
Byte (8 bits).
Definition: fx_system.h:644
int FX_ERR
Error indicator.
Definition: fx_system.h:668