Fix roslyn install with AOT disabled.
[mono-project.git] / mono / metadata / decimal-ms.h
blob451de4ab25598c6469bc987b8862e00eb62f3d88
1 #ifndef __MONO_DECIMAL_MS_H__
2 #define __MONO_DECIMAL_MS_H__
4 typedef struct {
5 // Decimal.cs treats the first two shorts as one long
6 // And they seriable the data so we need to little endian
7 // seriliazation
8 // The wReserved overlaps with Variant's vt member
9 #if G_BYTE_ORDER != G_LITTLE_ENDIAN
10 union {
11 struct {
12 uint8_t sign;
13 uint8_t scale;
14 } u;
15 uint16_t signscale;
16 } u;
17 uint16_t reserved;
18 #else
19 uint16_t reserved;
20 union {
21 struct {
22 uint8_t scale;
23 uint8_t sign;
24 } u;
25 uint16_t signscale;
26 } u;
27 #endif
28 uint32_t Hi32;
29 union {
30 struct {
31 uint32_t Lo32;
32 uint32_t Mid32;
33 } v;
34 uint64_t Lo64;
35 } v;
36 } MonoDecimal;
38 typedef enum {
39 MONO_DECIMAL_CMP_LT=-1,
40 MONO_DECIMAL_CMP_EQ,
41 MONO_DECIMAL_CMP_GT
42 } MonoDecimalCompareResult;
44 MonoDecimalCompareResult
45 mono_decimal_compare (MonoDecimal *left, MonoDecimal *right);
47 void mono_decimal_init_single (MonoDecimal *_this, float value);
48 void mono_decimal_init_double (MonoDecimal *_this, double value);
49 void mono_decimal_floor (MonoDecimal *d);
50 int32_t mono_decimal_get_hash_code (MonoDecimal *d);
51 void mono_decimal_multiply (MonoDecimal *d1, MonoDecimal *d2);
52 void mono_decimal_round (MonoDecimal *d, int32_t decimals);
53 void mono_decimal_tocurrency (MonoDecimal *decimal);
54 double mono_decimal_to_double (MonoDecimal d);
55 int32_t mono_decimal_to_int32 (MonoDecimal d);
56 float mono_decimal_to_float (MonoDecimal d);
57 void mono_decimal_truncate (MonoDecimal *d);
58 void mono_decimal_addsub (MonoDecimal *left, MonoDecimal *right, uint8_t sign);
59 void mono_decimal_divide (MonoDecimal *left, MonoDecimal *right);
60 int mono_decimal_from_number (void *from, MonoDecimal *target);
62 #endif