stdint.h revision 9f87a0b285128542a221f2b69d3b959a4e33c054
1a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project/*
2a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * Copyright (C) 2008 The Android Open Source Project
3a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * All rights reserved.
4a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *
5a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * Redistribution and use in source and binary forms, with or without
6a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * modification, are permitted provided that the following conditions
7a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * are met:
8a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *  * Redistributions of source code must retain the above copyright
9a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *    notice, this list of conditions and the following disclaimer.
10a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *  * Redistributions in binary form must reproduce the above copyright
11a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *    notice, this list of conditions and the following disclaimer in
12a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *    the documentation and/or other materials provided with the
13a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *    distribution.
14a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project *
15a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project * SUCH DAMAGE.
27a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project */
28a9a02acc9f5d7b13c742172fe1763840eecd8578Elliott Hughes
29a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project#ifndef _STDINT_H
30a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project#define _STDINT_H
31a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
32a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project#include <stddef.h>
339f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughes
349f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef __signed char __int8_t;
359f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef unsigned char __uint8_t;
369f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef short __int16_t;
379f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef unsigned short __uint16_t;
389f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef int __int32_t;
399f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef unsigned int __uint32_t;
409f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughes#if __LP64__
419f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef long __int64_t;
429f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef unsigned long __uint64_t;
439f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughes#else
449f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef long long __int64_t;
459f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef unsigned long long __uint64_t;
469f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughes#endif
479f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughes
489f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughes#if __LP64__
499f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef long __intptr_t;
509f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef unsigned long __uintptr_t;
519f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughes#else
529f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef int __intptr_t;
539f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef unsigned int __uintptr_t;
549f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughes#endif
55a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
56a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef __int8_t      int8_t;
57a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef __uint8_t     uint8_t;
58e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes
59a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef __int16_t     int16_t;
60a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef __uint16_t    uint16_t;
61e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes
62a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef __int32_t     int32_t;
63a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef __uint32_t    uint32_t;
64e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes
65a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef __int64_t     int64_t;
66a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef __uint64_t    uint64_t;
67a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
689f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef __intptr_t    intptr_t;
699f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef __uintptr_t   uintptr_t;
709f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughes
71a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef int8_t        int_least8_t;
72a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef int8_t        int_fast8_t;
73a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
74a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef uint8_t       uint_least8_t;
75a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef uint8_t       uint_fast8_t;
76a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
77a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef int16_t       int_least16_t;
78a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef int32_t       int_fast16_t;
79a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
80a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef uint16_t      uint_least16_t;
81a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef uint32_t      uint_fast16_t;
82a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
83a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef int32_t       int_least32_t;
84a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef int32_t       int_fast32_t;
85a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
86a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef uint32_t      uint_least32_t;
87a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef uint32_t      uint_fast32_t;
88a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
89a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef int64_t       int_least64_t;
90a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef int64_t       int_fast64_t;
91a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
92a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef uint64_t      uint_least64_t;
93a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Projecttypedef uint64_t      uint_fast64_t;
94a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
959f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef uint64_t      uintmax_t;
969f87a0b285128542a221f2b69d3b959a4e33c054Elliott Hughestypedef int64_t       intmax_t;
97debc021491530ff014166d48232b906d66a62b54Serban Constantinescu
98e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes/* Keep the kernel from trying to define these types... */
99e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define __BIT_TYPES_DEFINED__
100debc021491530ff014166d48232b906d66a62b54Serban Constantinescu
101e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT8_C(c)         c
102e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_LEAST8_C(c)   INT8_C(c)
103e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_FAST8_C(c)    INT8_C(c)
104a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
105e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT8_C(c)        c
106e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_LEAST8_C(c)  UINT8_C(c)
107e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_FAST8_C(c)   UINT8_C(c)
108a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
109e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT16_C(c)        c
110e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_LEAST16_C(c)  INT16_C(c)
111e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_FAST16_C(c)   INT32_C(c)
112a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
113e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT16_C(c)       c
114e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_LEAST16_C(c) UINT16_C(c)
115e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_FAST16_C(c)  UINT32_C(c)
116e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT32_C(c)        c
117e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_LEAST32_C(c)  INT32_C(c)
118e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_FAST32_C(c)   INT32_C(c)
119a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project
120e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT32_C(c)       c ## U
121e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_LEAST32_C(c) UINT32_C(c)
122e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_FAST32_C(c)  UINT32_C(c)
123e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_LEAST64_C(c)  INT64_C(c)
124e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_FAST64_C(c)   INT64_C(c)
1257c89506e3af3ee97691a98329f0d7b5edef49218Elliott Hughes
126e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_LEAST64_C(c) UINT64_C(c)
127e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_FAST64_C(c)  UINT64_C(c)
1287c89506e3af3ee97691a98329f0d7b5edef49218Elliott Hughes
129e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INTMAX_C(c)       INT64_C(c)
130e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINTMAX_C(c)      UINT64_C(c)
1317c89506e3af3ee97691a98329f0d7b5edef49218Elliott Hughes
132e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#ifdef __LP64__
133e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define INT64_C(c)      c ## L
134e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define UINT64_C(c)     c ## UL
135e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define INTPTR_C(c)     INT64_C(c)
136e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define UINTPTR_C(c)    UINT64_C(c)
137e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define PTRDIFF_C(c)    INT64_C(c)
138e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#else
139e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define INT64_C(c)      c ## LL
140e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define UINT64_C(c)     c ## ULL
141e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define INTPTR_C(c)     INT32_C(c)
142e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define UINTPTR_C(c)    UINT32_C(c)
143e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define PTRDIFF_C(c)    INT32_C(c)
144e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#endif
145e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes
146e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT8_MIN         (-128)
147e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT8_MAX         (127)
148e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_LEAST8_MIN   INT8_MIN
149e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_LEAST8_MAX   INT8_MAX
150e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_FAST8_MIN    INT8_MIN
151e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_FAST8_MAX    INT8_MAX
152e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes
153e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT8_MAX        (255)
154e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_LEAST8_MAX  UINT8_MAX
155e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_FAST8_MAX   UINT8_MAX
156e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes
157e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT16_MIN        (-32768)
158e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT16_MAX        (32767)
159e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_LEAST16_MIN  INT16_MIN
160e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_LEAST16_MAX  INT16_MAX
161e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_FAST16_MIN   INT32_MIN
162e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_FAST16_MAX   INT32_MAX
163e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes
164e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT16_MAX       (65535)
165e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_LEAST16_MAX UINT16_MAX
166e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_FAST16_MAX  UINT32_MAX
167e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes
168e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT32_MIN        (-2147483647-1)
169e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT32_MAX        (2147483647)
170e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_LEAST32_MIN  INT32_MIN
171e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_LEAST32_MAX  INT32_MAX
172e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_FAST32_MIN   INT32_MIN
173e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_FAST32_MAX   INT32_MAX
174e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes
175e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT32_MAX       (4294967295U)
176e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_LEAST32_MAX UINT32_MAX
177e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_FAST32_MAX  UINT32_MAX
178e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes
179e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT64_MIN        (INT64_C(-9223372036854775807)-1)
180e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT64_MAX        (INT64_C(9223372036854775807))
181e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_LEAST64_MIN  INT64_MIN
182e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_LEAST64_MAX  INT64_MAX
183e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_FAST64_MIN   INT64_MIN
184e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INT_FAST64_MAX   INT64_MAX
185e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT64_MAX       (UINT64_C(18446744073709551615))
186e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes
187e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_LEAST64_MAX UINT64_MAX
188e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINT_FAST64_MAX  UINT64_MAX
189e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes
190e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INTMAX_MIN       INT64_MIN
191e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define INTMAX_MAX       INT64_MAX
192e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define UINTMAX_MAX      UINT64_MAX
193e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes
194e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define SIG_ATOMIC_MAX   INT32_MAX
195e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define SIG_ATOMIC_MIN   INT32_MIN
196e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes
197e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#ifndef WCHAR_MAX /* These might also have been defined by <wchar.h>. */
198e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define WCHAR_MAX      INT32_MAX
199e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define WCHAR_MIN      INT32_MIN
200e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#endif
201e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes
202e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define WINT_MAX         INT32_MAX
203e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#define WINT_MIN         INT32_MIN
2047c89506e3af3ee97691a98329f0d7b5edef49218Elliott Hughes
205e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#ifdef __LP64__
206e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define INTPTR_MIN     INT64_MIN
207e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define INTPTR_MAX     INT64_MAX
208e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define UINTPTR_MAX    UINT64_MAX
209e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define PTRDIFF_MIN    INT64_MIN
210e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define PTRDIFF_MAX    INT64_MAX
211e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define SIZE_MAX       UINT64_MAX
212e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#else
213e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define INTPTR_MIN     INT32_MIN
214e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define INTPTR_MAX     INT32_MAX
215e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define UINTPTR_MAX    UINT32_MAX
216e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define PTRDIFF_MIN    INT32_MIN
217e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define PTRDIFF_MAX    INT32_MAX
218e2a292d278b94fec3d078b1f1b27c1f89942c276Elliott Hughes#  define SIZE_MAX       UINT32_MAX
2197c89506e3af3ee97691a98329f0d7b5edef49218Elliott Hughes#endif
2207c89506e3af3ee97691a98329f0d7b5edef49218Elliott Hughes
221a27d2baa0c1a2ec70f47ea9199b1dd6762c8a34The Android Open Source Project#endif /* _STDINT_H */
222