summaryrefslogtreecommitdiff
path: root/include/mts/MTS_Stdint.h
blob: 9a6885b51eec3705c5faf18f282bf9a23fcf8d6c (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
 * Copyright (C) 2015 by Multi-Tech Systems
 *
 * This file is part of libmts.
 *
 * libmts is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * libmts is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with libmts.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

/*! \file   MTS_Stdint.h
 \brief  A set of defined types
 \date   28MAR12
 \author Sean Godinez

 A set of defined types
 */
#ifndef MTS_STDINT_H
#define MTS_STDINT_H

#ifdef WIN32
typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef __int64 int64_t;

typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;

#ifndef INT8_MIN
#define INT8_MIN  (-127i8 - 1)
#endif

#ifndef INT16_MIN
#define INT16_MIN (-32767i16 - 1)
#endif

#ifndef INT32_MIN
#define INT32_MIN (-2147483647i32 - 1)
#endif

#ifndef INT64_MIN
#define INT64_MIN (-9223372036854775807i64 - 1)
#endif

#ifndef INT8_MAX
#define INT8_MAX  (127i8)
#endif

#ifndef INT16_MAX
#define INT16_MAX (32767i16)
#endif

#ifndef INT32_MAX
#define INT32_MAX (2147483647i32)
#endif

#ifndef INT64_MAX
#define INT64_MAX (9223372036854775807i64)
#endif

#ifndef UINT8_MAX
#define UINT8_MAX  (0xffui8)
#endif

#ifndef UINT16_MAX
#define UINT16_MAX (0xffffui16)
#endif

#ifndef UINT32_MAX
#define UINT32_MAX (0xffffffffui32)
#endif

#ifndef UINT64_MAX
#define UINT64_MAX (0xffffffffffffffffui64)
#endif

#elif __cplusplus
#ifdef STDINT
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
#include <stdint.h>
#else
#include <cstdint>
#endif
#else
#include <stdint.h>
#endif

#endif