• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * If linux/types.h is already been included, assume it has defined
3 * everything we need.  (cross fingers)  Other header files may have
4 * also defined the types that we need.
5 */
6#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \
7	!defined(_EXT2_TYPES_H))
8#define _EXT2_TYPES_H
9
10@ASM_TYPES_HEADER@
11
12#ifndef HAVE___U8
13#define HAVE___U8
14#ifdef __U8_TYPEDEF
15typedef __U8_TYPEDEF __u8;
16#else
17typedef unsigned char __u8;
18#endif
19#endif /* HAVE___U8 */
20
21#ifndef HAVE___S8
22#define HAVE___S8
23#ifdef __S8_TYPEDEF
24typedef __S8_TYPEDEF __s8;
25#else
26typedef signed char __s8;
27#endif
28#endif /* HAVE___S8 */
29
30#ifndef HAVE___U16
31#define HAVE___U16
32#ifdef __U16_TYPEDEF
33typedef __U16_TYPEDEF __u16;
34#else
35#if (@SIZEOF_INT@ == 2)
36typedef	unsigned int	__u16;
37#else
38#if (@SIZEOF_SHORT@ == 2)
39typedef	unsigned short	__u16;
40#else
41#undef HAVE___U16
42  ?==error: undefined 16 bit type
43#endif /* SIZEOF_SHORT == 2 */
44#endif /* SIZEOF_INT == 2 */
45#endif /* __U16_TYPEDEF */
46#endif /* HAVE___U16 */
47
48#ifndef HAVE___S16
49#define HAVE___S16
50#ifdef __S16_TYPEDEF
51typedef __S16_TYPEDEF __s16;
52#else
53#if (@SIZEOF_INT@ == 2)
54typedef	int		__s16;
55#else
56#if (@SIZEOF_SHORT@ == 2)
57typedef	short		__s16;
58#else
59#undef HAVE___S16
60  ?==error: undefined 16 bit type
61#endif /* SIZEOF_SHORT == 2 */
62#endif /* SIZEOF_INT == 2 */
63#endif /* __S16_TYPEDEF */
64#endif /* HAVE___S16 */
65
66#ifndef HAVE___U32
67#define HAVE___U32
68#ifdef __U32_TYPEDEF
69typedef __U32_TYPEDEF __u32;
70#else
71#if (@SIZEOF_INT@ == 4)
72typedef	unsigned int	__u32;
73#else
74#if (@SIZEOF_LONG@ == 4)
75typedef	unsigned long	__u32;
76#else
77#if (@SIZEOF_SHORT@ == 4)
78typedef	unsigned short	__u32;
79#else
80#undef HAVE___U32
81 ?== error: undefined 32 bit type
82#endif /* SIZEOF_SHORT == 4 */
83#endif /* SIZEOF_LONG == 4 */
84#endif /* SIZEOF_INT == 4 */
85#endif /* __U32_TYPEDEF */
86#endif /* HAVE___U32 */
87
88#ifndef HAVE___S32
89#define HAVE___S32
90#ifdef __S32_TYPEDEF
91typedef __S32_TYPEDEF __s32;
92#else
93#if (@SIZEOF_INT@ == 4)
94typedef	int		__s32;
95#else
96#if (@SIZEOF_LONG@ == 4)
97typedef	long		__s32;
98#else
99#if (@SIZEOF_SHORT@ == 4)
100typedef	short		__s32;
101#else
102#undef HAVE___S32
103 ?== error: undefined 32 bit type
104#endif /* SIZEOF_SHORT == 4 */
105#endif /* SIZEOF_LONG == 4 */
106#endif /* SIZEOF_INT == 4 */
107#endif /* __S32_TYPEDEF */
108#endif /* HAVE___S32 */
109
110#ifndef HAVE___U64
111#define HAVE___U64
112#ifdef __U64_TYPEDEF
113typedef __U64_TYPEDEF __u64;
114#else
115#if (@SIZEOF_INT@ == 8)
116typedef unsigned int	__u64;
117#else
118#if (@SIZEOF_LONG_LONG@ == 8)
119typedef unsigned long long	__u64;
120#else
121#if (@SIZEOF_LONG@ == 8)
122typedef unsigned long	__u64;
123#else
124#undef HAVE___U64
125 ?== error: undefined 64 bit type
126#endif /* SIZEOF_LONG_LONG == 8 */
127#endif /* SIZEOF_LONG == 8 */
128#endif /* SIZEOF_INT == 8 */
129#endif /* __U64_TYPEDEF */
130#endif /* HAVE___U64 */
131
132#ifndef HAVE___S64
133#define HAVE___S64
134#ifdef __S64_TYPEDEF
135typedef __S64_TYPEDEF __s64;
136#else
137#if (@SIZEOF_INT@ == 8)
138typedef int		__s64;
139#else
140#if (@SIZEOF_LONG_LONG@ == 8)
141#if defined(__GNUC__)
142typedef __signed__ long long	__s64;
143#else
144typedef signed long long	__s64;
145#endif /* __GNUC__ */
146#else
147#if (@SIZEOF_LONG@ == 8)
148typedef long		__s64;
149#else
150#undef HAVE___S64
151 ?== error: undefined 64 bit type
152#endif /* SIZEOF_LONG_LONG == 8 */
153#endif /* SIZEOF_LONG == 8 */
154#endif /* SIZEOF_INT == 8 */
155#endif /* __S64_TYPEDEF */
156#endif /* HAVE___S64 */
157
158#undef __S8_TYPEDEF
159#undef __U8_TYPEDEF
160#undef __S16_TYPEDEF
161#undef __U16_TYPEDEF
162#undef __S32_TYPEDEF
163#undef __U32_TYPEDEF
164#undef __S64_TYPEDEF
165#undef __U64_TYPEDEF
166
167#endif /* _*_TYPES_H */
168
169#include <stdint.h>
170
171/* endian checking stuff */
172#ifndef EXT2_ENDIAN_H_
173#define EXT2_ENDIAN_H_
174
175#ifdef __CHECKER__
176# ifndef __bitwise
177#  define __bitwise		__attribute__((bitwise))
178# endif
179#define __force			__attribute__((force))
180#else
181# ifndef __bitwise
182#  define __bitwise
183# endif
184#define __force
185#endif
186
187typedef __u16	__bitwise	__le16;
188typedef __u32	__bitwise	__le32;
189typedef __u64	__bitwise	__le64;
190typedef __u16	__bitwise	__be16;
191typedef __u32	__bitwise	__be32;
192typedef __u64	__bitwise	__be64;
193
194#endif /* EXT2_ENDIAN_H_ */
195
196@PUBLIC_CONFIG_HEADER@
197