source: CIVL/include/headers/stdint.h@ 1aaefd4

main test-branch
Last change on this file since 1aaefd4 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 4.3 KB
Line 
1/*
2 * The header stdint.h declares sets of integer types having specified widths, and
3 * defines corresponding sets of macros
4 */
5
6#ifndef _STDINT_
7#define _STDINT_
8
9typedef signed char int8_t;
10typedef int int16_t;
11typedef long int int32_t;
12typedef long long int int64_t;
13
14typedef unsigned char uint8_t;
15typedef unsigned int uint16_t;
16typedef unsigned long int uint32_t;
17typedef unsigned long long int uint64_t;
18
19/* Small types. */
20
21/* Signed. */
22typedef signed char int_least8_t;
23typedef int int_least16_t;
24typedef long int int_least32_t;
25typedef long long int int_least64_t;
26
27/* Unsigned. */
28typedef unsigned char uint_least8_t;
29typedef unsigned int uint_least16_t;
30typedef unsigned long int uint_least32_t;
31typedef unsigned long long int uint_least64_t;
32
33/* Fast types. */
34
35/* Signed. */
36typedef signed char int_fast8_t;
37typedef int int_fast16_t;
38typedef long int int_fast32_t;
39typedef long long int int_fast64_t;
40
41/* Unsigned. */
42typedef unsigned char uint_fast8_t;
43typedef unsigned int uint_fast16_t;
44typedef unsigned long int uint_fast32_t;
45typedef unsigned long long int uint_fast64_t;
46
47/* Largest integral types. */
48typedef long long int intmax_t;
49typedef unsigned long long int uintmax_t;
50
51typedef long int intptr_t;
52typedef unsigned long int uintptr_t;
53
54#if (! defined(__cplusplus)) || defined(__STDC_LIMIT_MACROS)
55
56#define INT8_MIN (-127-1)
57#define INT16_MIN (-32767-1)
58#define INT32_MIN (-2147483647-1)
59#define INT64_MIN (-9223372036854775807LL-1LL)
60
61#define INT8_MAX +127
62#define INT16_MAX +32767
63#define INT32_MAX +2147483647
64#define INT64_MAX +9223372036854775807LL
65
66#define UINT8_MAX 255
67#define UINT16_MAX 65535
68#define UINT32_MAX 4294967295U
69#define UINT64_MAX 18446744073709551615ULL
70
71#define INT_LEAST8_MIN INT8_MIN
72#define INT_LEAST16_MIN INT16_MIN
73#define INT_LEAST32_MIN INT32_MIN
74#define INT_LEAST64_MIN INT64_MIN
75
76#define INT_LEAST8_MAX INT8_MAX
77#define INT_LEAST16_MAX INT16_MAX
78#define INT_LEAST32_MAX INT32_MAX
79#define INT_LEAST64_MAX INT64_MAX
80
81#define UINT_LEAST8_MAX UINT8_MAX
82#define UINT_LEAST16_MAX UINT16_MAX
83#define UINT_LEAST32_MAX UINT32_MAX
84#define UINT_LEAST64_MAX UINT64_MAX
85
86#define INT_FAST8_MIN INT8_MIN
87#define INT_FAST16_MIN INT16_MIN
88#define INT_FAST32_MIN INT32_MIN
89#define INT_FAST64_MIN INT64_MIN
90
91#define INT_FAST8_MAX INT8_MAX
92#define INT_FAST16_MAX INT16_MAX
93#define INT_FAST32_MAX INT32_MAX
94#define INT_FAST64_MAX INT64_MAX
95
96#define UINT_FAST8_MAX UINT8_MAX
97#define UINT_FAST16_MAX UINT16_MAX
98#define UINT_FAST32_MAX UINT32_MAX
99#define UINT_FAST64_MAX UINT64_MAX
100
101#if defined(__LP64__)
102#define INTPTR_MIN INT64_MIN
103#define INTPTR_MAX INT64_MAX
104#define UINTPTR_MAX UINT64_MAX
105#else
106#define INTPTR_MIN INT32_MIN
107#define INTPTR_MAX INT32_MAX
108#define UINTPTR_MAX UINT32_MAX
109#endif
110
111#define INTMAX_MIN INT64_MIN
112#define INTMAX_MAX INT64_MAX
113
114#define UINTMAX_MAX UINT64_MAX
115
116#if defined(__LP64__)
117#define PTRDIFF_MIN INT64_MIN
118#define PTRDIFF_MAX INT64_MAX
119#else
120#define PTRDIFF_MIN INT32_MIN
121#define PTRDIFF_MAX INT32_MAX
122#endif
123
124#define SIZE_MAX UINT32_MAX
125
126#define WCHAR_MAX INT32_MAX
127
128#endif
129
130#if (! defined(__cplusplus)) || defined(__STDC_CONSTANT_MACROS)
131
132#define INT8_C(v) ((int8_t)v)
133#define INT16_C(v) ((int16_t)v)
134#define INT32_C(v) (v ## L)
135#define INT64_C(v) (v ## LL)
136
137#define UINT8_C(v) ((uint8_t)v)
138#define UINT16_C(v) ((uint16_t)v)
139#define UINT32_C(v) (v ## UL)
140#define UINT64_C(v) (v ## ULL)
141
142#define INTMAX_C(v) (v ## LL)
143#define UINTMAX_C(v) (v ## ULL)
144
145#endif
146
147#endif
Note: See TracBrowser for help on using the repository browser.