Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if !NET_4_0
- // System.Decimal
- typedef struct
- {
- //Note that we are not taking care of endianess.
- union
- {
- uint32_t ss32;
- struct signscale
- {
- unsigned int reserved1 : 16;
- unsigned int scale : 8;
- unsigned int reserved2 : 7;
- unsigned int sign : 1;
- } signscale;
- } u;
- uint32_t hi32;
- uint32_t lo32;
- uint32_t mid32;
- } il2cpp_decimal_repr;
- #else
- typedef struct Il2CppDecimal
- {
- // Decimal.cs treats the first two shorts as one long
- // And they seriable the data so we need to little endian
- // seriliazation
- // The wReserved overlaps with Variant's vt member
- #if IL2CPP_BYTE_ORDER == IL2CPP_BIG_ENDIAN
- union
- {
- struct
- {
- uint8_t sign;
- uint8_t scale;
- } u;
- uint16_t signscale;
- } u;
- uint16_t reserved;
- #else
- uint16_t reserved;
- union
- {
- struct
- {
- uint8_t scale;
- uint8_t sign;
- } u;
- uint16_t signscale;
- } u;
- #endif
- uint32_t Hi32;
- union
- {
- struct
- {
- uint32_t Lo32;
- uint32_t Mid32;
- } v;
- uint64_t Lo64;
- } v;
- } Il2CppDecimal;
- // Structure to access an encoded double floating point
- typedef struct Il2CppDouble
- {
- #if IL2CPP_BYTE_ORDER == IL2CPP_BIG_ENDIAN
- uint32_t sign : 1;
- uint32_t exp : 11;
- uint32_t mantHi : 20;
- uint32_t mantLo : 32;
- #else // BIGENDIAN
- uint32_t mantLo : 32;
- uint32_t mantHi : 20;
- uint32_t exp : 11;
- uint32_t sign : 1;
- #endif
- } Il2CppDouble;
- typedef union Il2CppDouble_double
- {
- Il2CppDouble s;
- double d;
- } Il2CppDouble_double;
- typedef enum Il2CppDecimalCompareResult
- {
- IL2CPP_DECIMAL_CMP_LT = -1,
- IL2CPP_DECIMAL_CMP_EQ,
- IL2CPP_DECIMAL_CMP_GT
- } Il2CppDecimalCompareResult;
- // Structure to access an encoded single floating point
- typedef struct Il2CppSingle
- {
- #if IL2CPP_BYTE_ORDER == IL2CPP_BIG_ENDIAN
- uint32_t sign : 1;
- uint32_t exp : 8;
- uint32_t mant : 23;
- #else
- uint32_t mant : 23;
- uint32_t exp : 8;
- uint32_t sign : 1;
- #endif
- } Il2CppSingle;
- typedef union Il2CppSingle_float
- {
- Il2CppSingle s;
- float f;
- } Il2CppSingle_float;
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement