111
|
1 /*------------------------------------------------------------------
|
|
2 * safe_types.h - C99 std types & defs or Linux kernel equivalents
|
|
3 *
|
|
4 * March 2007, Bo Berry
|
|
5 * Modified 2012, Jonathan Toppins <jtoppins@users.sourceforge.net>
|
|
6 *
|
|
7 * Copyright (c) 2007-2013 by Cisco Systems, Inc
|
|
8 * All rights reserved.
|
|
9 *
|
|
10 * Permission is hereby granted, free of charge, to any person
|
|
11 * obtaining a copy of this software and associated documentation
|
|
12 * files (the "Software"), to deal in the Software without
|
|
13 * restriction, including without limitation the rights to use,
|
|
14 * copy, modify, merge, publish, distribute, sublicense, and/or
|
|
15 * sell copies of the Software, and to permit persons to whom the
|
|
16 * Software is furnished to do so, subject to the following
|
|
17 * conditions:
|
|
18 *
|
|
19 * The above copyright notice and this permission notice shall be
|
|
20 * included in all copies or substantial portions of the Software.
|
|
21 *
|
|
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
24 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
25 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
26 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
27 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
29 * OTHER DEALINGS IN THE SOFTWARE.
|
|
30 *------------------------------------------------------------------
|
|
31 */
|
|
32
|
|
33 #ifndef __SAFE_TYPES_H__
|
|
34 #define __SAFE_TYPES_H__
|
|
35
|
|
36 #ifdef __KERNEL__
|
|
37 /* linux kernel environment */
|
|
38
|
|
39 #include <linux/stddef.h>
|
|
40 #include <linux/types.h>
|
|
41 #include <linux/errno.h>
|
|
42
|
|
43 /* errno_t isn't defined in the kernel */
|
|
44 typedef int errno_t;
|
|
45
|
|
46 #else
|
|
47
|
|
48 #include <stdio.h>
|
|
49 #include <sys/types.h>
|
|
50 #ifndef _WRS_KERNEL
|
|
51 #include <inttypes.h>
|
|
52 #endif
|
|
53 #include <stdint.h>
|
|
54 #include <errno.h>
|
|
55
|
|
56 typedef int errno_t;
|
|
57
|
|
58 #include <stdbool.h>
|
|
59
|
|
60 #endif /* __KERNEL__ */
|
|
61 #endif /* __SAFE_TYPES_H__ */
|