source: mainline/uspace/lib/posix/stdint.h@ 244d6fd

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 244d6fd was 67c64b9f, checked in by Petr Koupy <petr.koupy@…>, 14 years ago

Hexadecimal literals in stdint.h changed to decimal literals.

  • Property mode set to 100644
File size: 2.8 KB
Line 
1/*
2 * Copyright (c) 2011 Petr Koupy
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
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.
16 *
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.
27 */
28
29/** @addtogroup libposix
30 * @{
31 */
32/** @file
33 */
34
35#ifndef POSIX_STDINT_H_
36#define POSIX_STDINT_H_
37
38#undef INT8_MAX
39#undef INT8_MIN
40#define INT8_MAX 127
41#define INT8_MIN (-128)
42
43#undef UINT8_MAX
44#undef UINT8_MIN
45#define UINT8_MAX 255
46#define UINT8_MIN 0
47
48#undef INT16_MAX
49#undef INT16_MIN
50#define INT16_MAX 32767
51#define INT16_MIN (-32768)
52
53#undef UINT16_MAX
54#undef UINT16_MIN
55#define UINT16_MAX 65535
56#define UINT16_MIN 0
57
58#undef INT32_MAX
59#undef INT32_MIN
60#define INT32_MAX 2147483647
61#define INT32_MIN (-INT32_MAX - 1)
62
63#undef UINT32_MAX
64#undef UINT32_MIN
65#define UINT32_MAX 4294967295U
66#define UINT32_MIN 0U
67
68#undef INT64_MAX
69#undef INT64_MIN
70#define INT64_MAX 9223372036854775807LL
71#define INT64_MIN (-INT64_MAX - 1LL)
72
73#undef UINT64_MAX
74#undef UINT64_MIN
75#define UINT64_MAX 18446744073709551615ULL
76#define UINT64_MIN 0ULL
77
78#undef OFF64_MAX
79#undef OFF64_MIN
80#define OFF64_MAX INT64_MAX
81#define OFF64_MIN INT64_MIN
82
83#undef AOFF64_MAX
84#undef AOFF64_MIN
85#define AOFF64_MAX UINT64_MAX
86#define AOFF64_MIN UINT64_MIN
87
88#include "libc/sys/types.h"
89
90typedef int64_t posix_intmax_t;
91typedef uint64_t posix_uintmax_t;
92
93// FIXME: should be integrated into build process similarly to uintptr_t
94typedef ssize_t posix_intptr_t;
95
96#ifndef LIBPOSIX_INTERNAL
97 #define intmax_t posix_intmax_t
98 #define uintmax_t posix_uintmax_t
99
100 #define intptr_t posix_intptr_t
101#endif
102
103#endif /* POSIX_STDINT_H_ */
104
105/** @}
106 */
Note: See TracBrowser for help on using the repository browser.