[b4d6252] | 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 | */
|
---|
[4cf8ca6] | 32 | /** @file Integer types.
|
---|
[b4d6252] | 33 | */
|
---|
| 34 |
|
---|
| 35 | #ifndef POSIX_STDINT_H_
|
---|
| 36 | #define POSIX_STDINT_H_
|
---|
| 37 |
|
---|
[8b5fb5e] | 38 | #include "libc/stdint.h"
|
---|
| 39 |
|
---|
[67c64b9f] | 40 | #undef INT8_MAX
|
---|
| 41 | #undef INT8_MIN
|
---|
| 42 | #define INT8_MAX 127
|
---|
| 43 | #define INT8_MIN (-128)
|
---|
| 44 |
|
---|
| 45 | #undef UINT8_MAX
|
---|
| 46 | #undef UINT8_MIN
|
---|
| 47 | #define UINT8_MAX 255
|
---|
| 48 | #define UINT8_MIN 0
|
---|
| 49 |
|
---|
| 50 | #undef INT16_MAX
|
---|
| 51 | #undef INT16_MIN
|
---|
| 52 | #define INT16_MAX 32767
|
---|
| 53 | #define INT16_MIN (-32768)
|
---|
| 54 |
|
---|
| 55 | #undef UINT16_MAX
|
---|
| 56 | #undef UINT16_MIN
|
---|
| 57 | #define UINT16_MAX 65535
|
---|
| 58 | #define UINT16_MIN 0
|
---|
| 59 |
|
---|
| 60 | #undef INT32_MAX
|
---|
| 61 | #undef INT32_MIN
|
---|
| 62 | #define INT32_MAX 2147483647
|
---|
| 63 | #define INT32_MIN (-INT32_MAX - 1)
|
---|
| 64 |
|
---|
| 65 | #undef UINT32_MAX
|
---|
| 66 | #undef UINT32_MIN
|
---|
| 67 | #define UINT32_MAX 4294967295U
|
---|
| 68 | #define UINT32_MIN 0U
|
---|
| 69 |
|
---|
| 70 | #undef INT64_MAX
|
---|
| 71 | #undef INT64_MIN
|
---|
| 72 | #define INT64_MAX 9223372036854775807LL
|
---|
| 73 | #define INT64_MIN (-INT64_MAX - 1LL)
|
---|
| 74 |
|
---|
| 75 | #undef UINT64_MAX
|
---|
| 76 | #undef UINT64_MIN
|
---|
| 77 | #define UINT64_MAX 18446744073709551615ULL
|
---|
| 78 | #define UINT64_MIN 0ULL
|
---|
| 79 |
|
---|
| 80 | #undef OFF64_MAX
|
---|
| 81 | #undef OFF64_MIN
|
---|
| 82 | #define OFF64_MAX INT64_MAX
|
---|
| 83 | #define OFF64_MIN INT64_MIN
|
---|
| 84 |
|
---|
| 85 | #undef AOFF64_MAX
|
---|
| 86 | #undef AOFF64_MIN
|
---|
| 87 | #define AOFF64_MAX UINT64_MAX
|
---|
| 88 | #define AOFF64_MIN UINT64_MIN
|
---|
| 89 |
|
---|
| 90 | #include "libc/sys/types.h"
|
---|
[b4d6252] | 91 |
|
---|
| 92 | typedef int64_t posix_intmax_t;
|
---|
| 93 | typedef uint64_t posix_uintmax_t;
|
---|
| 94 |
|
---|
| 95 | // FIXME: should be integrated into build process similarly to uintptr_t
|
---|
| 96 | typedef ssize_t posix_intptr_t;
|
---|
| 97 |
|
---|
| 98 | #ifndef LIBPOSIX_INTERNAL
|
---|
| 99 | #define intmax_t posix_intmax_t
|
---|
| 100 | #define uintmax_t posix_uintmax_t
|
---|
| 101 |
|
---|
| 102 | #define intptr_t posix_intptr_t
|
---|
| 103 | #endif
|
---|
| 104 |
|
---|
| 105 | #endif /* POSIX_STDINT_H_ */
|
---|
| 106 |
|
---|
| 107 | /** @}
|
---|
| 108 | */
|
---|