Move fourcc_t to fourcc.h
[helenos.git] / uspace / lib / posix / include / posix / stdint.h
blobfa440291fb80ebc28176251957c80620d7abd3dd
1 /*
2 * Copyright (c) 2011 Petr Koupy
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 /** @addtogroup libposix
30 * @{
32 /** @file Integer types.
35 #ifndef POSIX_STDINT_H_
36 #define POSIX_STDINT_H_
38 #ifndef __POSIX_DEF__
39 #define __POSIX_DEF__(x) x
40 #endif
42 #include "libc/stdint.h"
44 #undef INT8_MAX
45 #undef INT8_MIN
46 #define INT8_MAX 127
47 #define INT8_MIN (-128)
49 #undef UINT8_MAX
50 #undef UINT8_MIN
51 #define UINT8_MAX 255
52 #define UINT8_MIN 0
54 #undef INT16_MAX
55 #undef INT16_MIN
56 #define INT16_MAX 32767
57 #define INT16_MIN (-32768)
59 #undef UINT16_MAX
60 #undef UINT16_MIN
61 #define UINT16_MAX 65535
62 #define UINT16_MIN 0
64 #undef INT32_MAX
65 #undef INT32_MIN
66 #define INT32_MAX 2147483647
67 #define INT32_MIN (-INT32_MAX - 1)
69 #undef UINT32_MAX
70 #undef UINT32_MIN
71 #define UINT32_MAX 4294967295U
72 #define UINT32_MIN 0U
74 #undef INT64_MAX
75 #undef INT64_MIN
76 #define INT64_MAX 9223372036854775807LL
77 #define INT64_MIN (-INT64_MAX - 1LL)
79 #undef UINT64_MAX
80 #undef UINT64_MIN
81 #define UINT64_MAX 18446744073709551615ULL
82 #define UINT64_MIN 0ULL
84 #undef OFF64_MAX
85 #undef OFF64_MIN
86 #define OFF64_MAX INT64_MAX
87 #define OFF64_MIN INT64_MIN
89 #undef AOFF64_MAX
90 #undef AOFF64_MIN
91 #define AOFF64_MAX UINT64_MAX
92 #define AOFF64_MIN UINT64_MIN
94 #undef INTMAX_MIN
95 #undef INTMAX_MAX
96 #define INTMAX_MIN INT64_MIN
97 #define INTMAX_MAX INT64_MAX
99 #undef UINTMAX_MIN
100 #undef UINTMAX_MAX
101 #define UINTMAX_MIN UINT64_MIN
102 #define UINTMAX_MAX UINT64_MAX
105 * Fast* and least* integer types.
107 * The definitions below are correct as long as uint8/16/32/64_t are defined.
108 * Considering the entire rest of the system would break down if they were not,
109 * these definitions are just fine.
111 typedef uint8_t uint_least8_t;
112 typedef uint16_t uint_least16_t;
113 typedef uint32_t uint_least32_t;
114 typedef uint64_t uint_least64_t;
116 typedef int8_t int_least8_t;
117 typedef int16_t int_least16_t;
118 typedef int32_t int_least32_t;
119 typedef int64_t int_least64_t;
121 typedef uint8_t uint_fast8_t;
122 typedef uint16_t uint_fast16_t;
123 typedef uint32_t uint_fast32_t;
124 typedef uint64_t uint_fast64_t;
126 typedef int8_t int_fast8_t;
127 typedef int16_t int_fast16_t;
128 typedef int32_t int_fast32_t;
129 typedef int64_t int_fast64_t;
131 #endif /* POSIX_STDINT_H_ */
133 /** @}