types.h revision e87df5a63825a4aed74b06f10229ee463b26f5c1
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * IPRT - Types.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * available from http://www.virtualbox.org. This file is free software;
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * you can redistribute it and/or modify it under the terms of the GNU
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * General Public License (GPL) as published by the Free Software
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * The contents of this file may alternatively be used under the terms
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * of the Common Development and Distribution License Version 1.0
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * VirtualBox OSE distribution, in which case the provisions of the
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * CDDL are applicable instead of those of the GPL.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * You may elect to license modified versions of this file under the
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * terms and conditions of either the GPL or the CDDL or both.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
87b2fb3f8283472ba7010aedbf2b4dc12302155cvboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
87b2fb3f8283472ba7010aedbf2b4dc12302155cvboxsync * additional information or have any questions.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * Include standard C types.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * Kludge for the darwin kernel:
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * stddef.h is missing IIRC.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * Kludge for the FreeBSD kernel:
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * stddef.h and sys/types.h has sligtly different offsetof definitions
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * when compiling in kernel mode. This is just to make GCC keep shut.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * Kludge for the linux kernel:
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * 1. sys/types.h doesn't mix with the kernel.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * 2. Starting with 2.6.19, linux/types.h typedefs bool and linux/stddef.h
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * declares false and true as enum values.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * 3. Starting with 2.6.24, linux/types.h typedefs uintptr_t.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * We work around these issues here and nowhere else.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync typedef bool _Bool;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync# define false linux_false
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/* Define any types missing from sys/types.h on windows. */
6edb4183bc898fddcd0987b6c5c3903b8246fe45vboxsync#else /* no crt */
6edb4183bc898fddcd0987b6c5c3903b8246fe45vboxsync#endif /* no crt */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/** @defgroup grp_rt_types IPRT Base Types
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/* define wchar_t, we don't wanna include all the wcsstuff to get this. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync typedef unsigned short wchar_t;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/** @todo wchar_t on GNUC */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * C doesn't have bool.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync# if defined(__GNUC__)
85c594c1140f082dd862abde9dc7825137a3d51avboxsynctypedef uint8_t bool;
85c594c1140f082dd862abde9dc7825137a3d51avboxsynctypedef _Bool bool;
85c594c1140f082dd862abde9dc7825137a3d51avboxsynctypedef unsigned char bool;
85c594c1140f082dd862abde9dc7825137a3d51avboxsync# ifndef true
85c594c1140f082dd862abde9dc7825137a3d51avboxsync# define true (1)
e38719852d98638514dba23fbacf53ad11361d6avboxsync# ifndef false
85c594c1140f082dd862abde9dc7825137a3d51avboxsync# define false (0)
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * 128-bit unsigned integer.
e38719852d98638514dba23fbacf53ad11361d6avboxsynctypedef struct uint128_s
1c8130d3c423590046a8ed4f3059de38ac5dcc14vboxsync * 128-bit signed integer.
1c8130d3c423590046a8ed4f3059de38ac5dcc14vboxsynctypedef struct int128_s
85c594c1140f082dd862abde9dc7825137a3d51avboxsync * 16-bit unsigned interger union.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** natural view. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** 16-bit view. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** 8-bit view. */
e38719852d98638514dba23fbacf53ad11361d6avboxsync /** 16-bit hi/lo view. */
bb06e22bdfd9b2cee861f442188cbdf2673633eevboxsync/** Pointer to a 16-bit unsigned interger union. */
4ad933b349952e43d0b6ce21b3f5e2833ca04e85vboxsync/** Pointer to a const 32-bit unsigned interger union. */
4ad933b349952e43d0b6ce21b3f5e2833ca04e85vboxsync * 32-bit unsigned interger union.
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** natural view. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** Hi/Low view. */
4ad933b349952e43d0b6ce21b3f5e2833ca04e85vboxsync /** Word view. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** 32-bit view. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** 16-bit view. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** 8-bit view. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/** Pointer to a 32-bit unsigned interger union. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/** Pointer to a const 32-bit unsigned interger union. */
6af51bfa1c7d9c89f657cac458247875a191ca48vboxsync * 64-bit unsigned interger union.
6af51bfa1c7d9c89f657cac458247875a191ca48vboxsync /** Natural view. */
6af51bfa1c7d9c89f657cac458247875a191ca48vboxsync /** Hi/Low view. */
e38719852d98638514dba23fbacf53ad11361d6avboxsync /** Double-Word view. */
e38719852d98638514dba23fbacf53ad11361d6avboxsync /** Word view. */
6af51bfa1c7d9c89f657cac458247875a191ca48vboxsync /** 64-bit view. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync /** 32-bit view. */
4ad933b349952e43d0b6ce21b3f5e2833ca04e85vboxsync /** 16-bit view. */
e38719852d98638514dba23fbacf53ad11361d6avboxsync /** 8-bit view. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/** Pointer to a 64-bit unsigned interger union. */
85c594c1140f082dd862abde9dc7825137a3d51avboxsync/** Pointer to a const 64-bit unsigned interger union. */
6edb4183bc898fddcd0987b6c5c3903b8246fe45vboxsync * 128-bit unsigned interger union.
51c2e697d33363fc2bbd49233b25addb678f5977vboxsync /** Natural view.
e38719852d98638514dba23fbacf53ad11361d6avboxsync * WARNING! This member depends on compiler supporing 128-bit stuff. */
6edb4183bc898fddcd0987b6c5c3903b8246fe45vboxsync /** Hi/Low view. */
6edb4183bc898fddcd0987b6c5c3903b8246fe45vboxsync /** Quad-Word view. */
51c2e697d33363fc2bbd49233b25addb678f5977vboxsync /** Double-Word view. */
87b2fb3f8283472ba7010aedbf2b4dc12302155cvboxsync /** Word view. */
df10dfd3a6bb44f9efa6ab00ef05106dce6e14e9vboxsync /** 64-bit view. */
b0dc8edd8414359c1d0f55edb4a4125cc04b1117vboxsync /** 32-bit view. */
} RTUINT128U;
typedef struct RTFAR16
} RTFAR16;
#pragma pack()
typedef struct RTFAR32
} RTFAR32;
#pragma pack()
typedef struct RTFAR64
} RTFAR64;
#pragma pack()
#ifndef IN_GC
typedef void * RTHCPTR;
#ifdef IN_RING3
typedef void * RTR3PTR;
#ifdef IN_RING0
typedef void * RTR0PTR;
#ifdef IN_GC
typedef void * RTRCPTR;
#ifdef IN_GC
#ifdef IN_GC
#define NIL_RTLDRMOD 0
#define NIL_RTR0MEMOBJ 0
#define NIL_RTSEMEVENT 0
#define NIL_RTSEMEVENTMULTI 0
#define NIL_RTSEMFASTMUTEX 0
#define NIL_RTSEMMUTEX 0
#define NIL_RTSEMRW 0
#define NIL_RTSPINLOCK 0
typedef int RTSOCKET;
#define NIL_RTTHREAD 0
typedef int RTTLS;
typedef union RTUUID
} Gen;
} RTUUID;
#define RT_INDEFINITE_WAIT (~0U)
typedef struct RTRECT
} RTRECT;