41 #if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3)) 59 #define LOGICAL_IS_A_TYPE 60 #define SPARSE_GENERALIZATION 63 # define double double_not_allowed 64 # define float float_not_allowed 73 # define FLT_MANT_DIG 24 74 # define DBL_MANT_DIG 53 83 #ifdef MATLAB_MEX_FILE 100 #if (defined(_MSC_VER) && _MSC_VER >= 1500) \ 101 || defined(__x86_64__) || defined(__LP64__) \ 102 || defined(__LCC64__) 103 typedef unsigned long long ulonglong_T;
111 #ifndef TMW_BITS_PER_INT 113 # if INT_MAX == 0x7FL 114 # define TMW_BITS_PER_INT 8 115 # elif INT_MAX == 0x7FFFL 116 # define TMW_BITS_PER_INT 16 117 # elif INT_MAX == 0x7FFFFFFFL 118 # define TMW_BITS_PER_INT 32 120 # define TMW_BITS_PER_INT -1 124 #ifndef TMW_BITS_PER_LONG 125 # if LONG_MAX == 0x7FL 126 # define TMW_BITS_PER_LONG 8 127 # elif LONG_MAX == 0x7FFFL 128 # define TMW_BITS_PER_LONG 16 129 # elif LONG_MAX == 0x7FFFFFFFL 130 # define TMW_BITS_PER_LONG 32 132 # define TMW_BITS_PER_LONG -1 136 #ifndef TMW_BITS_PER_SHRT 137 # if SHRT_MAX == 0x7FL 138 # define TMW_BITS_PER_SHRT 8 139 # elif SHRT_MAX == 0x7FFFL 140 # define TMW_BITS_PER_SHRT 16 141 # elif SHRT_MAX == 0x7FFFFFFFL 142 # define TMW_BITS_PER_SHRT 32 144 # define TMW_BITS_PER_SHRT -1 148 #ifndef TMW_BITS_PER_SCHAR 149 # if SCHAR_MAX == 0x7FL 150 # define TMW_BITS_PER_SCHAR 8 151 # elif SCHAR_MAX == 0x7FFFL 152 # define TMW_BITS_PER_SCHAR 16 153 # elif SCHAR_MAX == 0x7FFFFFFFL 154 # define TMW_BITS_PER_SCHAR 32 156 # define TMW_BITS_PER_SCHAR -1 160 #ifndef TMW_CHAR_SIGNED 161 # if SCHAR_MAX == CHAR_MAX 162 # define TMW_CHAR_SIGNED 1 164 # define TMW_CHAR_SIGNED 0 205 # if TMW_BITS_PER_INT == 8 207 # elif TMW_BITS_PER_LONG == 8 209 # elif TMW_BITS_PER_SCHAR == 8 210 # define INT8_T signed char 211 # elif TMW_BITS_PER_SHRT == 8 212 # define INT8_T short 216 typedef INT8_T int8_T;
220 # if TMW_BITS_PER_INT == 8 221 # define UINT8_T unsigned int 222 # elif TMW_BITS_PER_LONG == 8 223 # define UINT8_T unsigned long 224 # elif TMW_BITS_PER_SCHAR == 8 225 # define UINT8_T unsigned char 226 # elif TMW_BITS_PER_SHRT == 8 227 # define UINT8_T unsigned short 231 typedef UINT8_T uint8_T;
236 # if TMW_BITS_PER_INT == 16 238 # elif TMW_BITS_PER_LONG == 16 239 # define INT16_T long 240 # elif TMW_BITS_PER_SCHAR == 16 241 # define INT16_T signed char 242 # elif TMW_BITS_PER_SHRT == 16 243 # define INT16_T short 247 typedef INT16_T int16_T;
252 # if TMW_BITS_PER_INT == 16 253 # define UINT16_T unsigned int 254 # elif TMW_BITS_PER_LONG == 16 255 # define UINT16_T unsigned long 256 # elif TMW_BITS_PER_SCHAR == 16 257 # define UINT16_T unsigned char 258 # elif TMW_BITS_PER_SHRT == 16 259 # define UINT16_T unsigned short 263 typedef UINT16_T uint16_T;
268 # if TMW_BITS_PER_INT == 32 270 # elif TMW_BITS_PER_LONG == 32 271 # define INT32_T long 272 # elif TMW_BITS_PER_SCHAR == 32 273 # define INT32_T signed char 274 # elif TMW_BITS_PER_SHRT == 32 275 # define INT32_T short 279 typedef INT32_T int32_T;
284 # if TMW_BITS_PER_INT == 32 285 # define UINT32_T unsigned int 286 # elif TMW_BITS_PER_LONG == 32 287 # define UINT32_T unsigned long 288 # elif TMW_BITS_PER_SCHAR == 32 289 # define UINT32_T unsigned char 290 # elif TMW_BITS_PER_SHRT == 32 291 # define UINT32_T unsigned short 295 typedef UINT32_T uint32_T;
300 # define INT8_T INT16_T 301 typedef INT8_T int8_T;
304 # define INT8_T INT32_T 305 typedef INT8_T int8_T;
312 # define UINT8_T UINT16_T 313 typedef UINT8_T uint8_T;
316 # define UINT8_T UINT32_T 317 typedef UINT8_T uint8_T;
324 # define INT16_T INT32_T 325 typedef INT16_T int16_T;
331 # define UINT16_T UINT32_T 332 typedef UINT16_T uint16_T;
341 # if FLT_MANT_DIG >= 23 342 # define REAL32_T float 345 # define REAL32_T float 355 # if DBL_MANT_DIG >= 52 356 # define REAL64_T double 359 # define REAL64_T double 381 # if defined(__APPLE__) 382 # define INT64_T long long 384 # if defined(__LP64__) && !defined(INT_TYPE_64_IS_LONG) 385 # define INT_TYPE_64_IS_LONG 387 # elif defined(__x86_64__) || defined(__LP64__) 388 # define INT64_T long 390 # if !defined(INT_TYPE_64_IS_LONG) 391 # define INT_TYPE_64_IS_LONG 393 # elif defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) \ 394 || (defined(__WATCOMC__) && __WATCOMC__ >= 1100) 395 # define INT64_T __int64 397 # elif defined(__GNUC__) || defined(TMW_ENABLE_INT64) \ 398 || defined(__LCC64__) 399 # define INT64_T long long 407 # if defined(__GNUC__) && \ 408 ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >=9))) 411 typedef INT64_T int64_T;
417 # if defined(__APPLE__) 418 # define UINT64_T unsigned long long 420 # if defined(__LP64__) && !defined(INT_TYPE_64_IS_LONG) 421 # define INT_TYPE_64_IS_LONG 423 # elif defined(__x86_64__) || defined(__LP64__) 424 # define UINT64_T unsigned long 426 # if !defined(INT_TYPE_64_IS_LONG) 427 # define INT_TYPE_64_IS_LONG 429 # elif defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) \ 430 || (defined(__WATCOMC__) && __WATCOMC__ >= 1100) 431 # define UINT64_T unsigned __int64 433 # elif defined(__GNUC__) || defined(TMW_ENABLE_INT64) \ 434 || defined(__LCC64__) 435 # define UINT64_T unsigned long long 440 #if defined(_WIN64) || (defined(__APPLE__) && defined(__LP64__)) \ 441 || defined(__x86_64__) \ 443 # define INT_TYPE_64_IS_SUPPORTED 446 #if defined(UINT64_T) 447 # if defined(__GNUC__) && \ 448 ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >=9))) 451 typedef UINT64_T uint64_T;
465 # if defined( __GNUC__ ) || defined(_STDC_C99) 466 # define FMT_SIZE_T "z" 467 # elif defined (__WATCOMC__) 468 # define FMT_SIZE_T "l" 469 # elif defined (_WIN32 ) 470 # define FMT_SIZE_T "I" 472 # define FMT_SIZE_T "l" 476 #ifndef FMT_PTRDIFF_T 477 # if defined(__APPLE__) 478 # define FMT_PTRDIFF_T "l" 479 # elif defined( __GNUC__ ) || defined(_STDC_C99) 480 # define FMT_PTRDIFF_T "t" 481 # elif defined (__WATCOMC__) 482 # define FMT_PTRDIFF_T "l" 483 # elif defined (_WIN32 ) 484 # define FMT_PTRDIFF_T "I" 486 # define FMT_PTRDIFF_T "l" 511 # define REAL_T real64_T 514 # define REAL_T real32_T 524 # define TIME_T real_T 534 # if defined(UINT8_T) 535 # define BOOLEAN_T UINT8_T 537 # define BOOLEAN_T unsigned int 544 # define CHARACTER_T char 550 # define INTEGER_T int 556 # define UINTEGER_T unsigned 562 # define BYTE_T unsigned char 583 # define CREAL32_T creal32_T 592 # define CREAL64_T creal64_T 601 # define CREAL_T creal_T 612 # define CINT8_T cint8_T 621 # define CUINT8_T cuint8_T 630 # define CINT16_T cint16_T 639 # define CUINT16_T cuint16_T 648 # define CINT32_T cint32_T 657 # define CUINT32_T cuint32_T 666 # define CINT64_T cint64_T 675 # define CUINT64_T cuint64_T 692 #define MAX_int8_T ((int8_T)(127)) 693 #define MIN_int8_T ((int8_T)(-128)) 694 #define MAX_uint8_T ((uint8_T)(255)) 695 #define MIN_uint8_T ((uint8_T)(0)) 697 #define MAX_int16_T ((int16_T)(32767)) 698 #define MIN_int16_T ((int16_T)(-32768)) 699 #define MAX_uint16_T ((uint16_T)(65535)) 700 #define MIN_uint16_T ((uint16_T)(0)) 702 #define MAX_int32_T ((int32_T)(2147483647)) 703 #define MIN_int32_T ((int32_T)(-2147483647-1)) 704 #define MAX_uint32_T ((uint32_T)(0xFFFFFFFFU)) 705 #define MIN_uint32_T ((uint32_T)(0)) 707 #if defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) \ 708 || (defined(__WATCOMC__) && __WATCOMC__ >= 1100) \ 709 || defined(__LCC64__) 711 # define MAX_int64_T ((int64_T)(9223372036854775807LL)) 712 # define MIN_int64_T ((int64_T)(-9223372036854775807LL-1LL)) 715 # define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFULL)) 716 # define MIN_uint64_T ((uint64_T)(0)) 720 # ifdef INT_TYPE_64_IS_LONG 721 # define MAX_int64_T ((int64_T)(9223372036854775807L)) 722 # define MIN_int64_T ((int64_T)(-9223372036854775807L-1L)) 724 # define MAX_int64_T ((int64_T)(9223372036854775807LL)) 725 # define MIN_int64_T ((int64_T)(-9223372036854775807LL-1LL)) 729 # ifdef INT_TYPE_64_IS_LONG 730 # define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFUL)) 731 # define MIN_uint64_T ((uint64_T)(0)) 733 # define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFULL)) 734 # define MIN_uint64_T ((uint64_T)(0)) 757 # define uint64_to_double(u) ( ((u) > _I64_MAX) ? \ 758 (double)(__int64)((u) - _I64_MAX - 1) + (double)_I64_MAX + 1: \ 759 (double)(__int64)(u) ) 766 uint64_T double_to_uint64_helper(
double d) {
767 union double_to_uint64_union_type {
772 return (((di.i64 & 0x000fffffffffffff) | 0x0010000000000000) << 11);
783 # define double_to_uint64(d) ( ((d) >= 18446744073709551616.0) ? \ 784 0xffffffffffffffffULL : \ 785 ((d) < 0.0) ? 0ULL : \ 786 ((d) >= 9223372036854775808.0) ? \ 787 double_to_uint64_helper(d) : \ 788 (unsigned __int64)(d) ) 790 # define uint64_to_double(u) ((double)(u)) 791 # if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__TICCSC__) 794 # define double_to_uint64(d) ( ((d) > 0xffffffffffffffffULL) ? \ 795 (unsigned long long) 0xffffffffffffffffULL : \ 796 ((d) < 0) ? (unsigned long long) 0 : (unsigned long long)(d) ) 805 #if !defined(__cplusplus) && !defined(__bool_true_false_are_defined) 831 #if ((SCHAR_MIN + 1) != -SCHAR_MAX) 832 #error "This code must be compiled using a 2's complement representation for signed integer values" 841 #define TMW_NAME_LENGTH_MAX 64 861 #if (defined(_LP64) || defined(_WIN64)) && !defined(MX_COMPAT_32) 862 # define MWSIZE_MAX 281474976710655UL 864 # define MWINDEX_MAX 281474976710655UL 865 # define MWSINDEX_MAX 281474976710655L 866 # define MWSINDEX_MIN -281474976710655L 868 # define MWSIZE_MAX 2147483647UL 869 # define MWINDEX_MAX 2147483647UL 870 # define MWSINDEX_MAX 2147483647L 871 # define MWSINDEX_MIN -2147483647L 873 #define MWSIZE_MIN 0UL 874 #define MWINDEX_MIN 0UL 882 #if (defined(__cplusplus) && (__cplusplus >= 201103L)) || (defined(_HAS_CHAR16_T_LANGUAGE_SUPPORT) && _HAS_CHAR16_T_LANGUAGE_SUPPORT) 885 #define U16_STRING_LITERAL_PREFIX u 886 #elif defined(_MSC_VER) 888 #define U16_STRING_LITERAL_PREFIX L
size_t mwSize
unsigned pointer-width integer
ptrdiff_t mwSignedIndex
a signed pointer-width integer
size_t mwIndex
unsigned pointer-width integer