VirtualBox

source: kBuild/trunk/src/kash/shtypes.h@ 1239

Last change on this file since 1239 was 1233, checked in by bird, 17 years ago

keywords.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 2.4 KB
Line 
1/* $Id: shtypes.h 1233 2007-10-09 23:24:41Z bird $ */
2/** @file
3 *
4 * Wrapper for missing types and such.
5 *
6 * Copyright (c) 2007 knut st. osmundsen <[email protected]>
7 *
8 *
9 * This file is part of kBuild.
10 *
11 * kBuild is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * kBuild is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with kBuild; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 */
26
27#ifndef ___shtypes_h___
28#define ___shtypes_h___
29
30#include <sys/types.h>
31#include <stdlib.h>
32
33#ifdef _MSC_VER
34# include <io.h> /* intptr_t and uintptr_t */
35typedef signed char int8_t;
36typedef unsigned char uint8_t;
37typedef short int16_t;
38typedef unsigned short uint16_t;
39typedef int int32_t;
40typedef unsigned int uint32_t;
41typedef _int64 int64_t;
42typedef unsigned _int64 uint64_t;
43
44#define INT16_C(c) (c)
45#define INT32_C(c) (c)
46#define INT64_C(c) (c ## LL)
47
48#define UINT8_C(c) (c)
49#define UINT16_C(c) (c)
50#define UINT32_C(c) (c ## U)
51#define UINT64_C(c) (c ## ULL)
52
53#define INTMAX_C(c) (c ## LL)
54#define UINTMAX_C(c) (c ## ULL)
55
56#undef INT8_MIN
57#define INT8_MIN (-0x7f-1)
58#undef INT16_MIN
59#define INT16_MIN (-0x7fff-1)
60#undef INT32_MIN
61#define INT32_MIN (-0x7fffffff-1)
62#undef INT64_MIN
63#define INT64_MIN (-0x7fffffffffffffffLL-1)
64
65#undef INT8_MAX
66#define INT8_MAX 0x7f
67#undef INT16_MAX
68#define INT16_MAX 0x7fff
69#undef INT32_MAX
70#define INT32_MAX 0x7fffffff
71#undef INT64_MAX
72#define INT64_MAX 0x7fffffffffffffffLL
73
74#undef UINT8_MAX
75#define UINT8_MAX 0xff
76#undef UINT16_MAX
77#define UINT16_MAX 0xffff
78#undef UINT32_MAX
79#define UINT32_MAX 0xffffffffU
80#undef UINT64_MAX
81#define UINT64_MAX 0xffffffffffffffffULL
82
83typedef int pid_t;
84typedef unsigned short uid_t;
85typedef unsigned short gid_t;
86typedef int mode_t;
87typedef intptr_t ssize_t;
88
89#else
90# include <stdint.h>
91#endif
92
93struct shinstance;
94typedef struct shinstance shinstance;
95
96#endif
97
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette