Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CommonTypes.h « inc « Runtime « Native « src - github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1951d9d148e2f58c6cb390d5ae045a0fa6ab7993 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#ifndef __COMMON_TYPES_H__
#define __COMMON_TYPES_H__

#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <new>

using std::nothrow;
using std::size_t;
using std::uintptr_t;
using std::intptr_t;

//
// These type names are chosen to match the C# types
//
typedef int8_t              Int8;
typedef int16_t             Int16;
typedef int32_t             Int32;
typedef int64_t             Int64;
typedef uint8_t             UInt8;
typedef uint16_t            UInt16;
typedef uint32_t            UInt32;
typedef uint64_t            UInt64;
typedef intptr_t            IntNative;  // intentional deviation from C# IntPtr
typedef uintptr_t           UIntNative; // intentional deviation from C# UIntPtr
typedef wchar_t             WCHAR;
typedef void *              HANDLE;

typedef unsigned char       Boolean;
#define Boolean_false 0
#define Boolean_true 1

typedef UInt32              UInt32_BOOL;    // windows 4-byte BOOL, 0 -> false, everything else -> true
#define UInt32_FALSE        0
#define UInt32_TRUE         1

#define UInt16_MAX          ((UInt16)0xffffU)
#define UInt16_MIN          ((UInt16)0x0000U)

#define UInt32_MAX          ((UInt32)0xffffffffU)
#define UInt32_MIN          ((UInt32)0x00000000U)

#define Int32_MAX           ((Int32)0x7fffffff)
#define Int32_MIN           ((Int32)0x80000000)

#define UInt64_MAX          ((UInt64)0xffffffffffffffffUL)
#define UInt64_MIN          ((UInt64)0x0000000000000000UL)

#endif // __COMMON_TYPES_H__