Debian Codegraph @

sys/v4l2/ext/types-compat.h

raw
1 /*
2 * Copyright (C) 2014 Collabora Ltd.
3 * Author: Nicolas Dufresne <[email protected]>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 *
20 */
21
22 #include <glib.h>
23
24 #ifndef __TYPES_COMPAT_H__
25 #define __TYPES_COMPAT_H__
26
27 #define __inline__ inline
28
29 #ifdef __linux__
30 #include <linux/types.h>
31 #include <asm/ioctl.h>
32
33 #else /* One of the BSDs */
34 /* From linux/types.h */
35 #ifndef __bitwise__
36 # ifdef __CHECKER__
37 # define __bitwise__ __attribute__((bitwise))
38 # else
39 # define __bitwise__
40 # endif
41 #endif
42
43 #if defined(__sun)
44 /* for _IOR/_IORW on Illumos distros */
45 #include <sys/ioccom.h>
46 #endif
47
48 #ifndef __bitwise
49 # ifdef __CHECK_ENDIAN__
50 # define __bitwise __bitwise__
51 # else
52 # define __bitwise
53 # endif
54 #endif
55
56 typedef gint8 __s8;
57 typedef guint8 __u8;
58 typedef gint16 __s16;
59 typedef guint16 __u16;
60 typedef gint32 __s32;
61 typedef guint32 __u32;
62 typedef gint64 __s64;
63 typedef guint64 __u64;
64 typedef guint32 __bitwise __le32;
65
66 #endif
67
68 #endif /* __TYPES_COMPAT_H__ */