~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/include/nolibc/stdint.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
  2 /*
  3  * Standard definitions and types for NOLIBC
  4  * Copyright (C) 2023 Vincent Dagonneau <v@vda.io>
  5  */
  6 
  7 #ifndef _NOLIBC_STDINT_H
  8 #define _NOLIBC_STDINT_H
  9 
 10 typedef unsigned char       uint8_t;
 11 typedef   signed char        int8_t;
 12 typedef unsigned short     uint16_t;
 13 typedef   signed short      int16_t;
 14 typedef unsigned int       uint32_t;
 15 typedef   signed int        int32_t;
 16 typedef unsigned long long uint64_t;
 17 typedef   signed long long  int64_t;
 18 typedef __SIZE_TYPE__        size_t;
 19 typedef   signed long       ssize_t;
 20 typedef unsigned long     uintptr_t;
 21 typedef   signed long      intptr_t;
 22 typedef   signed long     ptrdiff_t;
 23 
 24 typedef   int8_t       int_least8_t;
 25 typedef  uint8_t      uint_least8_t;
 26 typedef  int16_t      int_least16_t;
 27 typedef uint16_t     uint_least16_t;
 28 typedef  int32_t      int_least32_t;
 29 typedef uint32_t     uint_least32_t;
 30 typedef  int64_t      int_least64_t;
 31 typedef uint64_t     uint_least64_t;
 32 
 33 typedef   int8_t        int_fast8_t;
 34 typedef  uint8_t       uint_fast8_t;
 35 typedef  ssize_t       int_fast16_t;
 36 typedef   size_t      uint_fast16_t;
 37 typedef  ssize_t       int_fast32_t;
 38 typedef   size_t      uint_fast32_t;
 39 typedef  int64_t       int_fast64_t;
 40 typedef uint64_t      uint_fast64_t;
 41 
 42 typedef  int64_t           intmax_t;
 43 typedef uint64_t          uintmax_t;
 44 
 45 /* limits of integral types */
 46 
 47 #define        INT8_MIN  (-128)
 48 #define       INT16_MIN  (-32767-1)
 49 #define       INT32_MIN  (-2147483647-1)
 50 #define       INT64_MIN  (-9223372036854775807LL-1)
 51 
 52 #define        INT8_MAX  (127)
 53 #define       INT16_MAX  (32767)
 54 #define       INT32_MAX  (2147483647)
 55 #define       INT64_MAX  (9223372036854775807LL)
 56 
 57 #define       UINT8_MAX  (255)
 58 #define      UINT16_MAX  (65535)
 59 #define      UINT32_MAX  (4294967295U)
 60 #define      UINT64_MAX  (18446744073709551615ULL)
 61 
 62 #define  INT_LEAST8_MIN  INT8_MIN
 63 #define INT_LEAST16_MIN  INT16_MIN
 64 #define INT_LEAST32_MIN  INT32_MIN
 65 #define INT_LEAST64_MIN  INT64_MIN
 66 
 67 #define  INT_LEAST8_MAX  INT8_MAX
 68 #define INT_LEAST16_MAX  INT16_MAX
 69 #define INT_LEAST32_MAX  INT32_MAX
 70 #define INT_LEAST64_MAX  INT64_MAX
 71 
 72 #define  UINT_LEAST8_MAX UINT8_MAX
 73 #define UINT_LEAST16_MAX UINT16_MAX
 74 #define UINT_LEAST32_MAX UINT32_MAX
 75 #define UINT_LEAST64_MAX UINT64_MAX
 76 
 77 #define SIZE_MAX         ((size_t)(__LONG_MAX__) * 2 + 1)
 78 #define INTPTR_MIN       (-__LONG_MAX__ - 1)
 79 #define INTPTR_MAX       __LONG_MAX__
 80 #define PTRDIFF_MIN      INTPTR_MIN
 81 #define PTRDIFF_MAX      INTPTR_MAX
 82 #define UINTPTR_MAX      SIZE_MAX
 83 
 84 #define  INT_FAST8_MIN   INT8_MIN
 85 #define INT_FAST16_MIN   INTPTR_MIN
 86 #define INT_FAST32_MIN   INTPTR_MIN
 87 #define INT_FAST64_MIN   INT64_MIN
 88 
 89 #define  INT_FAST8_MAX   INT8_MAX
 90 #define INT_FAST16_MAX   INTPTR_MAX
 91 #define INT_FAST32_MAX   INTPTR_MAX
 92 #define INT_FAST64_MAX   INT64_MAX
 93 
 94 #define  UINT_FAST8_MAX  UINT8_MAX
 95 #define UINT_FAST16_MAX  SIZE_MAX
 96 #define UINT_FAST32_MAX  SIZE_MAX
 97 #define UINT_FAST64_MAX  UINT64_MAX
 98 
 99 #define INTMAX_MIN       INT64_MIN
100 #define INTMAX_MAX       INT64_MAX
101 #define UINTMAX_MAX      UINT64_MAX
102 
103 #ifndef INT_MIN
104 #define INT_MIN          (-__INT_MAX__ - 1)
105 #endif
106 #ifndef INT_MAX
107 #define INT_MAX          __INT_MAX__
108 #endif
109 
110 #ifndef LONG_MIN
111 #define LONG_MIN         (-__LONG_MAX__ - 1)
112 #endif
113 #ifndef LONG_MAX
114 #define LONG_MAX         __LONG_MAX__
115 #endif
116 
117 #ifndef ULONG_MAX
118 #define ULONG_MAX         ((unsigned long)(__LONG_MAX__) * 2 + 1)
119 #endif
120 
121 #ifndef LLONG_MIN
122 #define LLONG_MIN         (-__LONG_LONG_MAX__ - 1)
123 #endif
124 #ifndef LLONG_MAX
125 #define LLONG_MAX         __LONG_LONG_MAX__
126 #endif
127 
128 #ifndef ULLONG_MAX
129 #define ULLONG_MAX         ((unsigned long long)(__LONG_LONG_MAX__) * 2 + 1)
130 #endif
131 
132 #endif /* _NOLIBC_STDINT_H */
133 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php