1 /* 2 * Copyright (C) 2014 Collabora Ltd. 3 * Author: Nicolas Dufresne <nicolas@ndufresne.ca> 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 #ifdef __linux__ 28 #include <linux/types.h> 29 #include <asm/ioctl.h> 30 31 #else /* One of the BSDs */ 32 /* From linux/types.h */ 33 #ifndef __bitwise__ 34 # ifdef __CHECKER__ 35 # define __bitwise__ __attribute__((bitwise)) 36 # else 37 # define __bitwise__ 38 # endif 39 #endif 40 41 #ifndef __bitwise 42 # ifdef __CHECK_ENDIAN__ 43 # define __bitwise __bitwise__ 44 # else 45 # define __bitwise 46 # endif 47 #endif 48 49 typedef guint8 __u8; 50 typedef guint16 __u16; 51 typedef gint32 __s32; 52 typedef guint32 __u32; 53 typedef gint64 __s64; 54 typedef guint64 __u64; 55 typedef guint32 __bitwise __le32; 56 57 #endif 58 59 #endif /* __TYPES_COMPAT_H__ */ 60