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 #if defined(_FXM_PLATFORM_LINUX_JS_) || defined(_CHROME_PNACL_) 160 #define _FX_OS_ _FX_LINUX_DESKTOP_ 161 #define _FXM_PLATFORM_ _FXM_PLATFORM_LINUX_ 167 #if defined(__SYMBIAN32__) || defined(__symbian__) 168 #define _FX_OS_ _FX_SYMBIAN_ 169 #elif defined(_WIN32_WCE) 170 #define _FX_OS_ _FX_WIN32_MOBILE_ 171 #define _FXM_PLATFORM_ _FXM_PLATFORM_WINDOWS_ 172 #if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) 173 #define UNSUPPORT_CPP0X 175 #elif defined(__linux__) || defined(__native_client__) 176 #if ((defined(__arm__) || defined(__aarch64__)) && defined(__ARM_EABI__)) && (!defined(OS_CHROMEOS)) 177 #define _FX_OS_ _FX_LINUX_EMBEDDED_ 179 #define _FX_OS_ _FX_LINUX_DESKTOP_ 181 #define _FXM_PLATFORM_ _FXM_PLATFORM_LINUX_ 182 #elif defined(__NetBSD__) 183 #define _FX_OS_ _FX_NETBSD_ 184 #elif defined(_WIN64) 185 #define _FX_OS_ _FX_WIN64_ 186 #define _FXM_PLATFORM_ _FXM_PLATFORM_WINDOWS_ 187 #elif defined(_WIN32) 188 #define _FX_OS_ _FX_WIN32_DESKTOP_ 189 #define _FXM_PLATFORM_ _FXM_PLATFORM_WINDOWS_ 190 #elif defined(__sparc__) 191 #define _FX_OS_ _FX_SOLARIS_ 192 #define _FXM_PLATFORM_ _FXM_PLATFORM_LINUX_ 193 #elif defined(__ARMCC_VERSION) || defined(__ICCARM__) || defined(__TMS470__) 194 #define _FX_OS_ _FX_EMBEDDED_ 195 #elif defined(__APPLE__) 196 #include "TargetConditionals.h" 197 #if (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1) || (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR == 1) 198 #define _FX_OS_ _FX_IOS_ 200 #define _FX_OS_ _FX_MACOSX_ 202 #define _FXM_PLATFORM_ _FXM_PLATFORM_APPLE_ 203 #elif defined(__ARM_EABI__) 204 #define _FX_OS_ _FX_EMBEDDED_ 207 #if _FX_OS_ == _FX_ANDROID_ 208 #ifndef _FXM_PLATFORM_ 209 #define _FXM_PLATFORM_ _FXM_PLATFORM_ANDROID_ 211 #elif (_FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_ || _FX_OS_ == _FX_WIN32_DESKTOP_) 212 #ifndef _FXM_PLATFORM_ 213 #define _FXM_PLATFORM_ _FXM_PLATFORM_WINDOWS_ 215 #elif (_FX_OS_ == _FX_IOS_ || _FX_OS_ == _FX_MACOSX_) 216 #ifndef _FXM_PLATFORM_ 217 #define _FXM_PLATFORM_ _FXM_PLATFORM_APPLE_ 219 #elif _FX_OS_ == _FX_SOLARIS_ || _FX_OS_ == _FX_LINUX_EMBEDDED_ || _FX_OS_ == _FX_LINUX_DESKTOP_ 220 #ifndef _FXM_PLATFORM_ 221 #define _FXM_PLATFORM_ _FXM_PLATFORM_LINUX_ 226 #if !defined(_FX_OS_) || _FX_OS_ == 0 227 #error Sorry, can not figure out what OS you are targeting to. Please specify _FX_OS_ macro. 231 #if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_) && !defined(_FX_NO_WINDOWS_) 233 #define _CRT_SECURE_NO_WARNINGS 234 #if defined(_MSC_VER) && _MSC_VER < 1300 235 #define _WIN32_WINNT 0x400 237 #if defined(_MSC_VER) && _MSC_VER < 1600 238 #define UNSUPPORT_CPP0X 246 #if (0x00000001 == WINAPI_PARTITION_DESKTOP) && (0x00000002 == WINAPI_PARTITION_APP) //Macros in Windows Kit/8 248 #else //Macros in Windows Kit/8.1 250 #endif //(0x00000001 == WINAPI_PARTITION_DESKTOP) && (0x00000002 == WINAPI_PARTITION_APP) 253 #if ((WINAPI_FAMILY&WINAPI_PARTITION_APP) == WINAPI_PARTITION_APP) 255 #define _FX_WINAPI_PARTITION_APP_ 257 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY&WINAPI_PARTITION_DESKTOP) == WINAPI_PARTITION_DESKTOP) 259 #define _FX_WINAPI_PARTITION_DESKTOP_ 265 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PC_APP) 267 #define _FX_WINAPI_PARTITION_APP_ 270 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PC_APP) 272 #define _FX_WINAPI_PARTITION_PHONE_APP_ 275 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 277 #define _FX_WINAPI_PARTITION_DESKTOP_ 280 #else // !defined(WINAPI_FAMILY) 282 #define _FX_WINAPI_PARTITION_DESKTOP_ 284 #endif //WINAPI_FAMILY 285 #endif //(_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_) && !defined(_FX_NO_WINDOWS_) 310 #define _FX_NOKIA_X86_ 8 312 #define _FX_METROWERKS_ 9 316 #define _FX_TMS470_ 11 318 #define _FX_MIPS_SDE_ 12 321 #ifndef _FX_COMPILER_ 324 #define _FX_COMPILER_ _FX_VC8_ 325 #elif _MSC_VER >= 1300 326 #define _FX_COMPILER_ _FX_VC7_ 347 #define _FX_COMPILER_ _FX_VC6_ 349 #elif defined(__GNUC__) 350 #define _FX_COMPILER_ _FX_GCC_ 351 #elif defined(__ARMCC_VERSION) 352 #if __ARMCC_VERSION < 200000 353 #define _FX_COMPILER_ _FX_ADS_ 355 #define _FX_COMPILER_ _FX_RVCT_ 357 #elif defined(__ICCARM__) 358 #define _FX_COMPILER_ _FX_IARCC_ 359 #elif defined(_PACC_VER) 360 #define _FX_COMPILER_ _FX_PACC_ 361 #elif defined(__TMS470__) 362 #define _FX_COMPILER_ _FX_TMS470_ 365 #if !defined(_FX_COMPILER_) || _FX_COMPILER_ == 0 366 #error Sorry, can not figure out what compiler you are using. Please specify _FX_COMPILER_ macro. 382 #define _FX_POWERPC_ 3 394 #define _FX_MIPS64_ 9 396 #define _FX_LOONGARCH64_ 10 400 #if defined(_FXM_PLATFORM_LINUX_JS_) 401 #if defined(__wasm64__) 402 #define _FX_CPU_ _FX_X64_ 404 #define _FX_CPU_ _FX_X86_ 405 #endif // defined(__wasm64__) 406 #endif // defined(_FXM_PLATFORM_LINUX_JS_) 408 #if defined(_CHROME_PNACL_) 409 #define _FX_CPU_ _FX_X86_ 413 #if defined(__arm__) || defined(ARM) || defined(_ARM_) || defined(__ARMCC_VERSION) || defined(__ICCARM__) || defined(__arm) || defined(arm9) || defined(_M_ARM) 414 #define _FX_CPU_ _FX_ARM_ 415 #elif defined(__arm64) || defined(__arm64__) || defined(__aarch64__) || defined(_ARM64_) || defined(_M_ARM64) 416 #define _FX_CPU_ _FX_ARM64_ 417 #elif defined(_M_IX86) || defined(__i386__) 433 #define _FX_CPU_ _FX_X86_ 434 #elif defined(_M_X64) || defined(__x86_64__) 435 #define _FX_CPU_ _FX_X64_ 436 #elif defined(_M_IA64) 437 #define _FX_CPU_ _FX_IA64_ 438 #elif defined(__POWERPC__) 439 #define _FX_CPU_ _FX_POWERPC_ 440 #elif defined(__sparc__) 441 #define _FX_CPU_ _FX_SPARC_ 442 #elif defined(__mips64) 443 #define _FX_CPU_ _FX_MIPS64_ 444 #elif defined(__loongarch64) 445 #define _FX_CPU_ _FX_LOONGARCH64_ 446 #elif defined(__sw_64__) || defined(__sw_64) 447 #define _FX_CPU_ _FX_SW64_ 448 #elif defined(MIPS) || defined(_MIPS_) || defined(__mips) 449 #define _FX_CPU_ _FX_MIPS_ 452 #if !defined(_FX_CPU_) || _FX_CPU_ == 0 453 #error Sorry, can not figure out what CPU you are targeting to. Please specify _FX_CPU_ macro. 460 #define _FX_EMBEDFONT_PRINT_ 476 #ifndef _FX_WORDSIZE_ 477 #if defined(_WIN64) || defined(__arm64) || defined(__arm64__) || defined(_M_AMD64) || \ 478 defined(_M_X64) || defined(_M_IA64) || defined(__powerpc64__) || defined(__x86_64__) || \ 479 __WORDSIZE == 64 || defined(__LP64__) || defined(__mips64) || defined(__loongarch64) 480 #define _FX_WORDSIZE_ _FX_W64_ 482 #define _FX_WORDSIZE_ _FX_W32_ 495 #define _FX_BIG_ENDIAN_ 1 497 #define _FX_LITTLE_ENDIAN_ 2 501 #if _FX_CPU_ == _FX_POWERPC_ || _FX_CPU_ == _FX_SPARC_ 502 #define _FX_ENDIAN_ _FX_BIG_ENDIAN_ 513 #define _FX_ENDIAN_ _FX_LITTLE_ENDIAN_ 526 #ifndef _FX_NO_ANSIC_ 531 #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_) 538 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ 539 #include <libkern/OSAtomic.h> 540 #if _FX_OS_ == _FX_MACOSX_ 541 #include <Carbon/Carbon.h> 542 #elif _FX_OS_ == _FX_IOS_ 543 #include <CoreText/CoreText.h> 544 #include <CoreGraphics/CoreGraphics.h> 550 #define GetObject GetObjectW 551 #define GetModuleFileName GetModuleFileNameW 552 #define GetFullPathName GetFullPathNameW 558 #define GetObject GetObjectA 564 #define GetModuleFileName GetModuleFileNameA 570 #define GetFullPathName GetFullPathNameA 573 #if ( _FX_OS_ == _FX_IOS_ && (_FX_CPU_ == _FX_ARM_ || _FX_CPU_ == _FX_ARM64_)) || (_FX_OS_ == _FX_ANDROID_) || (_FX_OS_ == _FX_WIN32_MOBILE_) 574 #ifndef _FXCORE_LIMITED_MEMORY_ 575 #define _FXCORE_LIMITED_MEMORY_ 577 #ifndef _FXCORE_LIMITED_CPU_ 578 #define _FXCORE_LIMITED_CPU_ 582 #if _FX_COMPILER_ == _FX_ADS_ || _FX_COMPILER_ == _FX_RVCT_ || _FX_COMPILER_ == _FX_TMS470_ || _FX_OS_ == _FX_ANDROID_ 584 #define _FX_NO_NAMESPACE_ 593 #define _FX_DEFAULT_TARGET_ 0 600 #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_) 602 #if !defined(_FXM_PLATFORM_LINUX_JS_) && !defined(_CHROME_PNACL_) && (_FX_CPU_ != _FX_ARM_) && \ 603 (_FX_CPU_ != _FX_ARM64_) && (_FX_CPU_ != _FX_MIPS_) && (_FX_CPU_ != _FX_MIPS64_) && \ 604 (_FX_CPU_ != _FX_LOONGARCH64_) && (_FX_CPU_ != _FX_SW64_) 609 #if _FX_OS_ != _FX_MACOSX_ 613 #ifndef _FX_NO_OPENSSL_ 614 #define _FX_NO_OPENSSL_ 617 #if (((_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_) && defined(_FX_WINAPI_PARTITION_DESKTOP_)) || _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_MACOSX_) 618 #ifndef _FX_NO_JPEG_TURBO_ 619 #if !defined(_CHROME_PNACL_) 620 #define _FX_JPEG_TURBO_ 623 #ifndef _FX_NO_OPENSSL_ 624 #define _FXM_OPENSSL_ 626 #define _FX_LARGEFILE_SUPPORT_ 630 #define _FPDF_STREAM_RENDER_ 631 #ifndef _FX_ENABLE_OVERPRINT_ 632 #define _FX_ENABLE_OVERPRINT_ 636 #if _FX_OS_ == _FX_LINUX_EMBEDDED_ 637 #ifndef _FX_ENABLE_OVERPRINT_ 638 #define _FX_ENABLE_OVERPRINT_ 642 #ifdef _FX_WINAPI_PARTITION_APP_ 643 #define _FPDF_STREAM_RENDER_ 700 #define FX_SUCCEEDED(Status) ((FX_ERR)(Status) >= 0) 702 #define FX_FAILED(Status) ((FX_ERR)(Status) < 0) 721 #if !defined(_MSC_VER) && (_FX_CPU_ == _FX_X64_ || _FX_CPU_ == _FX_IA64_ || _FX_CPU_ == _FX_ARM64_ || _FX_CPU_ == _FX_MIPS64_ || _FX_CPU_ == _FX_LOONGARCH64_ || _FX_CPU_ == _FX_SW64_) 742 typedef __int64 FX_INT64;
744 typedef unsigned __int64 FX_UINT64;
746 typedef long long int FX_INT64;
747 typedef unsigned long long FX_UINT64;
750 #if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_) && !defined(_FX_NO_WINDOWS_) 756 #if (_FX_CPU_ == _FX_X64_ || _FX_CPU_ == _FX_IA64_ || _FX_CPU_ == _FX_ARM64_ || _FX_CPU_ == _FX_MIPS64_ || _FX_CPU_ == _FX_LOONGARCH64_|| _FX_CPU_ == _FX_SW64_) 773 #define FX_DEFINEHANDLE(name) typedef struct _##name {FX_LPVOID pData;} * name; 775 #if defined(DEBUG) && !defined(_DEBUG) 800 #if !defined(_FX_NO_ANSIC_) 805 #define FXSYS_assert assert 814 #define ASSERT FXSYS_assert 825 #define FX_MAX(a, b) (((a) > (b)) ? (a) : (b)) 827 #define FX_MIN(a, b) (((a) < (b)) ? (a) : (b)) 830 #define FX_PI 3.1415926535897932384626433832795f 833 #if _FX_WORDSIZE_ == _FX_W64_ && _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 834 #define _FX_CRT_MALLOC_LIMIT_ 0x7fffffffffffffffL 836 #define _FX_CRT_MALLOC_LIMIT_ 0x7fffffffL 849 #if !defined(_FX_NO_ANSIC_) 854 #define FXSYS_sprintf sprintf 860 #define FXSYS_snprintf _snprintf 861 #define FXSYS_vsnprintf _vsnprintf 863 #define FXSYS_snprintf snprintf 864 #define FXSYS_vsnprintf vsnprintf 870 #define FXSYS_vsprintf vsprintf 875 #define FXSYS_strchr strchr 880 #define FXSYS_strlen strlen 885 #define FXSYS_strncmp strncmp 890 #define FXSYS_strcmp strcmp 895 #define FXSYS_strcpy strcpy 900 #define FXSYS_strncpy strncpy 905 #define FXSYS_strstr strstr 908 int FXSYS_vsprintf(
char *buffer,
const char *format, va_list args);
911 int FXSYS_strncmp(
const char* str1,
const char* str2,
size_t len);
914 char*
FXSYS_strncpy(
char* dest,
const char* src,
size_t len);
915 char*
FXSYS_strstr(
const char *
string,
const char *strFind);
926 #if !defined(_FX_NO_ANSIC_) && !defined(__EMSCRIPTEN__) 931 #define FXSYS_FILE FILE 936 #define FXSYS_fopen fopen 941 #define FXSYS_fclose fclose 946 #define FXSYS_SEEK_END SEEK_END 951 #define FXSYS_SEEK_SET SEEK_SET 956 #define FXSYS_fseek fseek 961 #define FXSYS_ftell ftell 966 #define FXSYS_fread fread 971 #define FXSYS_fwrite fwrite 976 #define FXSYS_fprintf fprintf 981 #define FXSYS_fflush fflush 983 #define FXSYS_FILE void 986 #define FXSYS_SEEK_END 2 987 #define FXSYS_SEEK_SET 0 997 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_ 1002 #ifdef _NATIVE_WCHAR_T_DEFINED 1003 #define FXSYS_wfopen(f, m) _wfopen((const wchar_t*)(f), (const wchar_t*)(m)) 1005 #define FXSYS_wfopen _wfopen 1020 #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_ 1021 #ifdef _NATIVE_WCHAR_T_DEFINED 1022 #define FXSYS_wcslen(str) wcslen((wchar_t*)(str)) 1023 #define FXSYS_wcscmp(str1, str2) wcscmp((wchar_t*)(str1), (wchar_t*)(str2)) 1029 #define FXSYS_wcslen wcslen 1034 #define FXSYS_wcscmp wcscmp 1042 #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_ 1043 #ifdef _NATIVE_WCHAR_T_DEFINED 1044 #define FXSYS_wcschr(str, ch) (FX_LPCWSTR)wcschr((wchar_t*)(str), ch) 1045 #define FXSYS_wcsstr(str1, str2) (FX_LPCWSTR)wcsstr((wchar_t*)(str1), (wchar_t*)(str2)) 1046 #define FXSYS_wcsncmp(str1, str2, n) wcsncmp((wchar_t*)(str1), (wchar_t*)(str2), n) 1052 #define FXSYS_wcschr wcschr 1057 #define FXSYS_wcsstr wcsstr 1062 #define FXSYS_wcsncmp wcsncmp 1068 #define FXSYS_vswprintf vswprintf 1073 #if _FX_OS_ != _FX_ANDROID_ 1076 #define FXSYS_vswprintf vswprintf 1080 #if !defined(_FX_NO_ANSIC_) && _FX_COMPILER_ != _FX_TMS470_ 1085 #define FXSYS_mbstowcs mbstowcs 1090 #define FXSYS_wcstombs wcstombs 1105 #if !defined(_FX_NO_ANSIC_) 1110 #define FXSYS_memcmp memcmp 1115 #define FXSYS_memcpy memcpy 1122 #define FXSYS_memmove memmove 1127 #define FXSYS_memset memset 1132 #define FXSYS_memchr memchr 1144 #if !defined(_FX_NO_ANSIC_) 1149 #define FXSYS_qsort qsort 1151 void FXSYS_qsort(
void*,
unsigned,
unsigned,
int (*)(
const void*,
const void*));
1154 #if _FX_OS_ != _FX_WIN32_MOBILE_ && !defined(_FX_NO_ANSIC_) && _FX_OS_ != _FX_SYMBIAN_ 1159 #define FXSYS_bsearch bsearch 1162 void *
FXSYS_bsearch(
const void *key,
const void *base,
size_t num,
size_t width,
int (*compare)(
const void *,
const void *));
1165 #if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_) && !defined(_FX_NO_WINDOWS_) 1172 #define FXSYS_itoa _itoa 1177 #define FXSYS_strlwr _strlwr 1182 #define FXSYS_strupr _strupr 1187 #define FXSYS_stricmp _stricmp 1189 #ifdef _NATIVE_WCHAR_T_DEFINED 1190 #define FXSYS_wcsicmp(str1, str2) _wcsicmp((wchar_t*)(str1), (wchar_t*)(str2)) 1191 #define FXSYS_WideCharToMultiByte(p1, p2, p3, p4, p5, p6, p7, p8) WideCharToMultiByte(p1, p2, (const wchar_t*)(p3), p4, p5, p6, p7, p8) 1192 #define FXSYS_MultiByteToWideChar(p1, p2, p3, p4, p5, p6) MultiByteToWideChar(p1, p2, p3, p4, (wchar_t*)(p5), p6) 1193 #define FXSYS_wcslwr(str) _wcslwr((wchar_t*)(str)) 1194 #define FXSYS_wcsupr(str) _wcsupr((wchar_t*)(str)) 1200 #define FXSYS_wcsicmp _wcsicmp 1205 #define FXSYS_WideCharToMultiByte WideCharToMultiByte 1210 #define FXSYS_MultiByteToWideChar MultiByteToWideChar 1215 #define FXSYS_wcslwr _wcslwr 1220 #define FXSYS_wcsupr _wcsupr 1223 #ifndef _FX_WINAPI_PARTITION_DESKTOP_ 1224 int FXSYS_IntersectRect(
struct FX_RECT*,
const struct FX_RECT*,
const struct FX_RECT*);
1233 #define FXSYS_GetFullPathName GetFullPathName 1238 #define FXSYS_GetModuleFileName GetModuleFileName 1243 #define FXSYS_GetACP GetACP 1246 char*
FXSYS_itoa(
int value,
char*
string,
int radix);
1249 char* buf,
int buflen,
const char* default_str,
int* pUseDefault);
1251 wchar_t* buf,
int buflen);
1258 int FXSYS_wcsicmp(
const wchar_t *string1,
const wchar_t *string2);
1356 #if _FX_OS_ == _FX_PALMOS_ && _FX_COMPILER_ == _FX_METROWERKS_ 1362 extern double __ieee754_pow(
double,
double);
1363 extern double __ieee754_sqrt(
double);
1364 extern double __fabs(
double);
1365 extern double __ieee754_atan2(
double,
double);
1366 extern double __ceil(
double);
1367 extern double __floor(
double);
1368 extern double __cos(
double);
1369 extern double __ieee754_acos(
double);
1370 extern double __sin(
double);
1371 extern double __ieee754_log(
double);
1372 extern double __ieee754_log10(
double);
1374 #define FXSYS_pow(x, y) __ieee754_pow(x, y) 1375 #define FXSYS_sqrt(x) __ieee754_sqrt(x) 1376 #define FXSYS_fabs(x) __fabs(x) 1377 #define FXSYS_atan2(x, y) __ieee754_atan2(x, y) 1378 #define FXSYS_ceil(x) __ceil(x) 1379 #define FXSYS_floor(x) __floor(x) 1380 #define FXSYS_cos(x) __cos(x) 1381 #define FXSYS_acos(x) __ieee754_acos(x) 1382 #define FXSYS_sin(x) __sin(x) 1383 #define FXSYS_log(x) __ieee754_log(x) 1384 #define FXSYS_log10(x) __ieee754_log10(x) 1391 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ || _FX_OS_ == _FX_LINUX_DESKTOP_ 1396 #define FXSYS_pow powf 1401 #define FXSYS_sqrt sqrtf 1406 #define FXSYS_fabs fabsf 1411 #define FXSYS_atan2 atan2f 1416 #define FXSYS_ceil ceilf 1421 #define FXSYS_floor floorf 1426 #define FXSYS_cos cosf 1431 #define FXSYS_acos acosf 1436 #define FXSYS_sin sinf 1441 #define FXSYS_log logf 1446 #define FXSYS_log10 log10f 1451 #define FXSYS_fmod fmodf 1453 #define FXSYS_pow(a, b) (FX_FLOAT)pow(a, b) 1454 #define FXSYS_sqrt(a) (FX_FLOAT)sqrt(a) 1455 #define FXSYS_fabs(a) (FX_FLOAT)fabs(a) 1456 #define FXSYS_atan2(a, b) (FX_FLOAT)atan2(a, b) 1457 #define FXSYS_ceil(a) (FX_FLOAT)ceil(a) 1458 #define FXSYS_floor(a) (FX_FLOAT)floor(a) 1459 #define FXSYS_cos(a) (FX_FLOAT)cos(a) 1460 #define FXSYS_acos(a) (FX_FLOAT)acos(a) 1461 #define FXSYS_sin(a) (FX_FLOAT)sin(a) 1462 #define FXSYS_log(a) (FX_FLOAT)log(a) 1463 #define FXSYS_log10(a) (FX_FLOAT)log10(a) 1464 #define FXSYS_fmod(a, b) (FX_FLOAT)fmod(a, b) 1468 #if !defined(_FX_NO_ANSIC_) 1473 #define FXSYS_abs abs 1475 #define FXSYS_abs(a) ((a)<0?-(a):(a)) 1488 #ifdef _FX_NO_GLOBAL_ 1491 void FXSYS_SetStaticPointer1(
void*);
1493 void* FXSYS_GetStaticPointer1(
void);
1495 void FXSYS_SetStaticPointer2(
void*);
1497 void* FXSYS_GetStaticPointer2(
void);
1501 #if _FX_ENDIAN_ == _FX_BIG_ENDIAN_ 1502 #define _FX_MSB_FIRST_ 1503 #define FXDWORD_FROM_LSBFIRST(i) ( ((FX_BYTE)(i) << 24) | ((FX_BYTE)((i) >> 8) << 16) | ((FX_BYTE)((i) >> 16) << 8) | (FX_BYTE)((i) >> 24) ) 1504 #define FXDWORD_FROM_MSBFIRST(i) (i) 1506 #define _FX_LSB_FIRST_ 1507 #define FXDWORD_FROM_LSBFIRST(i) (i) 1508 #define FXDWORD_FROM_MSBFIRST(i) ( ((FX_BYTE)(i) << 24) | ((FX_BYTE)((i) >> 8) << 16) | ((FX_BYTE)((i) >> 16) << 8) | (FX_BYTE)((i) >> 24) ) 1511 #if _FX_CPU_ == _FX_X86_ || _FX_CPU_ == _FX_X64_ || _FX_CPU_ == _FX_ARM64_ || _FX_CPU_ == _FX_MIPS64_ || _FX_CPU_ == _FX_LOONGARCH64_ || _FX_CPU_ == _FX_SW64_ 1512 #define FXDWORD_GET_LSBFIRST(p) (*(FX_DWORD*)(p)) 1514 #define FXDWORD_GET_LSBFIRST(p) ((((FX_LPBYTE)(p))[3] << 24) | (((FX_LPBYTE)(p))[2] << 16) | (((FX_LPBYTE)(p))[1] << 8) | (((FX_LPBYTE)(p))[0])) 1517 #define FXDWORD_GET_MSBFIRST(p) ((((FX_LPBYTE)(p))[0] << 24) | (((FX_LPBYTE)(p))[1] << 16) | (((FX_LPBYTE)(p))[2] << 8) | (((FX_LPBYTE)(p))[3])) 1519 #define FXSYS_HIBYTE(word) ((FX_BYTE)((word) >> 8)) 1520 #define FXSYS_LOBYTE(word) ((FX_BYTE)(word)) 1521 #define FXSYS_HIWORD(dword) ((FX_WORD)((dword) >> 16)) 1522 #define FXSYS_LOWORD(dword) ((FX_WORD)(dword)) 1525 #define FXSYS_strtol strtol 1588 #define FXSYS_Mul(a, b) ((a) * (b)) 1590 #define FXSYS_Div(a, b) ((a) / (b)) 1592 #define FXSYS_MulDiv(a, b, c) ((a) * (b) / (c)) 1594 #define FXSYS_sqrt2(a, b) (FX_FLOAT)FXSYS_sqrt((a)*(a) + (b)*(b)) 1600 #if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_) && !defined(_FX_NO_WINDOWS_) 1603 #elif _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_LINUX_EMBEDDED_ || _FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_ || _FX_OS_ == _FX_ANDROID_ 1604 #include <pthread.h> 1606 #if _FX_OS_ == _FX_ANDROID_ 1609 typedef pthread_rwlock_t FX_RWLOCK;
1617 void FX_Mutex_Destroy(
FX_MUTEX* pMutex);
1619 void FX_Mutex_Lock(
FX_MUTEX* pMutex);
1620 void FX_Mutex_Unlock(
FX_MUTEX* pMutex);
1622 #define FX_CRITICAL_SECTION FX_MUTEX 1623 #define FX_InitializeCriticalSection(a) FX_Mutex_Initialize(a) 1624 #define FX_DeleteCriticalSection(a) FX_Mutex_Destroy(a) 1625 #define FX_TryEnterCriticalSection(a) FX_Mutex_TryLock(a) 1626 #define FX_EnterCriticalSection(a) FX_Mutex_Lock(a) 1627 #define FX_LeaveCriticalSection(a) FX_Mutex_Unlock(a) 1630 #if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_) && !defined(_FX_NO_WINDOWS_) 1632 #elif _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_==_FX_LINUX_EMBEDDED_ 1633 #ifdef _FX_SPINLOCK_USEGCCCAS_ 1636 #ifndef _CHROME_PNACL_ 1642 #elif _FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_ 1644 #else // android/embeded linux/other os 1655 #if _FX_OS_ == _FX_PALMOS_ && _FX_COMPILER_ == _FX_PACC_ 1656 #include <errtrycatch.h> 1657 #define setjmp ErrSetJump 1658 #define longjmp ErrLongJump 1659 #define jmp_buf ErrJumpBuf 1664 #if _FX_OS_ == _FX_MACOSX_ 1665 #include <Carbon/Carbon.h> 1666 #elif _FX_OS_ == _FX_IOS_ 1667 #include <CoreText/CoreText.h> 1668 #include <CoreGraphics/CoreGraphics.h> void * FXSYS_memset8(void *dst, FX_BYTE v, size_t size)
Set buffer data to specified value.
void * FX_LPVOID
Pointer to any type.
Definition: fx_system.h:658
wchar_t FX_WCHAR
Compiler dependant Unicode character (16-bit for Microsoft Compiler, 32-bit for gcc).
Definition: fx_system.h:734
#define FXSYS_wcslwr
Convert a wide-character string to lowercase.
Definition: fx_system.h:1215
unsigned long FX_DWORD
32-bit unsigned integer.
Definition: fx_system.h:728
#define FXSYS_mbstowcs
Converts a sequence of multi-byte characters to a corresponding sequence of wide characters.
Definition: fx_system.h:1085
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:971
#define FXSYS_fprintf
Print formatted data to a file.
Definition: fx_system.h:976
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:1062
#define FXSYS_FILE
File structure.
Definition: fx_system.h:931
void const * FX_LPCVOID
Pointer to any constant type.
Definition: fx_system.h:660
int FXSYS_round(FX_FLOAT f)
Get nearest integer.
#define FXSYS_strcpy
Copy an ANSIC string.
Definition: fx_system.h:895
#define FXSYS_fflush
Flush file.
Definition: fx_system.h:981
FX_DWORD FX_UINT32
unsigned 32bits integer.
Definition: fx_system.h:768
wchar_t const * FX_LPCWSTR
Pointer to constant Unicode characters.
Definition: fx_system.h:738
#define FXSYS_GetFullPathName
Get the full path and file name of a specified file.
Definition: fx_system.h:1233
#define FXSYS_strlen
Get the length of a ANSIC string.
Definition: fx_system.h:880
#define FXSYS_wcsupr
Convert a wide-character string to uppercase.
Definition: fx_system.h:1220
#define FXSYS_strncpy
Copy an ANSIC string with length limitation.
Definition: fx_system.h:900
#define FXSYS_wcschr
Find a wide-character in a wide-character string.
Definition: fx_system.h:1052
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:707
#define FXSYS_wfopen
Open a file using wide-string parameters. Only supported on Windows platforms now.
Definition: fx_system.h:1005
#define FXSYS_memmove
Moves one buffer to another. If some regions of the source area and the destination overlap,...
Definition: fx_system.h:1122
CRITICAL_SECTION FX_MUTEX
Definition for mutex/critical section and read-write lock.
Definition: fx_system.h:1601
#define FXSYS_memcpy
Copy from one buffer to another.
Definition: fx_system.h:1115
void * FX_POSITION
A value used to denote the position of an element in a collection.
Definition: fx_system.h:662
#define FXSYS_vswprintf
Write formatted output wide character string using a pointer to a list of arguments.
Definition: fx_system.h:1068
#define FXSYS_itoa
Convert an integer to a ANSIC string.
Definition: fx_system.h:1172
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:875
#define FXSYS_strlwr
Convert a ANSIC string to lowercase.
Definition: fx_system.h:1177
int FX_INT32
32-bit signed integer.
Definition: fx_system.h:687
#define FXSYS_GetModuleFileName
Get the fully-qualified path for specified module.
Definition: fx_system.h:1238
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:1110
int FX_BOOL
Boolean variable (should be TRUE or FALSE).
Definition: fx_system.h:695
unsigned short * FX_LPWORD
Pointer to a WORD.
Definition: fx_system.h:683
#define FXSYS_fseek
Moves the file pointer to a specified location.
Definition: fx_system.h:956
char const * FX_LPCSTR
Pointer to constant 8-bit Windows (ANSI) characters.
Definition: fx_system.h:709
#define FXSYS_wcslen
Get the length of a wide-character string.
Definition: fx_system.h:1029
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:665
#define FXSYS_wcscmp
Compare wide-character strings.
Definition: fx_system.h:1034
#define FXSYS_GetACP
Retrieve the current ANSI code-page identifier for the system.
Definition: fx_system.h:1243
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:966
UINT_PTR FX_UINTPTR
Unsigned integral type for pointer precision.
Definition: fx_system.h:754
#define FXSYS_qsort
Performs a quick sort. A generic algorithm.
Definition: fx_system.h:1149
#define FXSYS_wcsicmp
Compare two wide character strings. case-insensitive.
Definition: fx_system.h:1200
void * FX_SPINLOCK
Definition for spinlock.
Definition: fx_system.h:1631
unsigned long * FX_LPDWORD
Pointer to a DWORD.
Definition: fx_system.h:730
short FX_SHORT
Short integer (16 bits).
Definition: fx_system.h:679
#define FXSYS_fopen
Open a file.
Definition: fx_system.h:936
#define FXSYS_bsearch
Performs a binary search of a sorted array. A generic algorithm.
Definition: fx_system.h:1159
#define FXSYS_MultiByteToWideChar
Maps a character string to a wide-character string.
Definition: fx_system.h:1210
unsigned char * FX_LPBYTE
Pointer to a FX_BYTE.
Definition: fx_system.h:671
#define FXSYS_strstr
Find a substring.
Definition: fx_system.h:905
#define FXSYS_wcsstr
Find a sub-wide-character-string.
Definition: fx_system.h:1057
char FX_CHAR
8-bit Windows (ANSI) character.
Definition: fx_system.h:705
float FX_FLOAT
32-bit floating-point number.
Definition: fx_system.h:689
#define FXSYS_assert
Assertion.
Definition: fx_system.h:805
unsigned short FX_UINT16
Unsigned 16bits integer.
Definition: fx_system.h:677
#define FXSYS_memchr
Search for a byte in a memory block.
Definition: fx_system.h:1132
#define FXSYS_strcmp
Compare ANSIC strings.
Definition: fx_system.h:890
#define FXSYS_WideCharToMultiByte
Maps a wide-character string to a character string.
Definition: fx_system.h:1205
unsigned char FX_UINT8
Unsigned 8bits integer.
Definition: fx_system.h:667
unsigned short const * FX_LPCWORD
Pointer to a WORD.
Definition: fx_system.h:685
#define FXSYS_fclose
Close a file.
Definition: fx_system.h:941
#define FXSYS_ftell
Gets the current position of a file pointer.
Definition: fx_system.h:961
#define FXSYS_stricmp
Compare two ANSIC strings. case-insensitive.
Definition: fx_system.h:1187
#define FXSYS_strncmp
Compare characters of two ANSIC strings.
Definition: fx_system.h:885
unsigned short FX_WORD
16-bit unsigned integer.
Definition: fx_system.h:681
short FX_INT16
Signed 16bits integer.
Definition: fx_system.h:675
#define FXSYS_memset
Use given character to initialize the buffer.
Definition: fx_system.h:1127
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:673
wchar_t * FX_LPWSTR
Pointer to Unicode characters.
Definition: fx_system.h:736
#define FXSYS_sprintf
Write formatted data to a ANSIC string.
Definition: fx_system.h:854
#define FX_DEFINEHANDLE(name)
Macro to define a handle type.
Definition: fx_system.h:773
#define FXSYS_wcstombs
Converts a sequence of wide characters to a corresponding sequence of multi-byte characters.
Definition: fx_system.h:1090
#define FXSYS_vsprintf
Write formatted output using a pointer to a list of arguments.
Definition: fx_system.h:870
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:1182
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:770
INT_PTR FX_INTPTR
Signed integral type for pointer precision.
Definition: fx_system.h:752
unsigned char FX_BYTE
Byte (8 bits).
Definition: fx_system.h:669
int FX_ERR
Error indicator.
Definition: fx_system.h:698