cdefs.h revision 51476822711c0337979e0345f7bf466ce7b8e34b
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * IPRT - Common C and C++ definitions.
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync * Copyright (C) 2006-2009 Sun Microsystems, Inc.
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync * available from http://www.virtualbox.org. This file is free software;
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * you can redistribute it and/or modify it under the terms of the GNU
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * General Public License (GPL) as published by the Free Software
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
e64031e20c39650a7bc902a3e1aba613b9415deevboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * The contents of this file may alternatively be used under the terms
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * of the Common Development and Distribution License Version 1.0
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * VirtualBox OSE distribution, in which case the provisions of the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * CDDL are applicable instead of those of the GPL.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * You may elect to license modified versions of this file under the
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * terms and conditions of either the GPL or the CDDL or both.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * additional information or have any questions.
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync/** @defgroup grp_rt_cdefs IPRT Common Definitions and Macros
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync * Include sys/cdefs.h if present, if not define the stuff we need.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync /** @def __BEGIN_DECLS
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Used to start a block of function declarations which are shared
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * between C and C++ program.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync /** @def __END_DECLS
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Used to end a block of function declarations which are shared
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * between C and C++ program.
ad27e1d5e48ca41245120c331cc88b50464813cevboxsync * Shut up DOXYGEN warnings and guide it properly thru the code.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync#endif /* DOXYGEN_RUNNING */
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync/** @def RT_ARCH_X86
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Indicates that we're compiling for the X86 architecture.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync/** @def RT_ARCH_AMD64
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync * Indicates that we're compiling for the AMD64 architecture.
a39ea3668b7019c23a68936259545f9b71bce1aavboxsync#if !defined(RT_ARCH_X86) && !defined(RT_ARCH_AMD64)
a39ea3668b7019c23a68936259545f9b71bce1aavboxsync# if defined(__amd64__) || defined(__x86_64__) || defined(_M_X64) || defined(__AMD64__)
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync# elif defined(__i386__) || defined(_M_IX86) || defined(__X86__)
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync# else /* PORTME: append test for new archs. */
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsync# error "Check what predefined macros your compiler uses to indicate architecture."
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsync#elif defined(RT_ARCH_X86) && defined(RT_ARCH_AMD64) /* PORTME: append new archs. */
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsync# error "Both RT_ARCH_X86 and RT_ARCH_AMD64 cannot be defined at the same time!"
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync/** @def __X86__
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Indicates that we're compiling for the X86 architecture.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @deprecated
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync/** @def __AMD64__
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync * Indicates that we're compiling for the AMD64 architecture.
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync * @deprecated
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsync# error "Check what predefined macros your compiler uses to indicate architecture."
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync# error "Both __X86__ and __AMD64__ cannot be defined at the same time!"
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync/** @def IN_RING0
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Used to indicate that we're compiling code which is running
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync * in Ring-0 Host Context.
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync/** @def IN_RING3
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync * Used to indicate that we're compiling code which is running
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync * in Ring-3 Host Context.
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync/** @def IN_RC
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync * Used to indicate that we're compiling code which is running
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync * in the Raw-mode Context (implies R0).
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync#if !defined(IN_RING3) && !defined(IN_RING0) && !defined(IN_RC) && !defined(IN_RC)
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync# error "You must define which context the compiled code should run in; IN_RING3, IN_RING0 or IN_RC"
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync#if (defined(IN_RING3) && (defined(IN_RING0) || defined(IN_RC)) ) \
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync || (defined(IN_RING0) && (defined(IN_RING3) || defined(IN_RC)) ) \
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync || (defined(IN_RC) && (defined(IN_RING3) || defined(IN_RING0)) )
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync# error "Only one of the IN_RING3, IN_RING0, IN_RC defines should be defined."
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync/** @def ARCH_BITS
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync * Defines the bit count of the current context.
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync/** @def HC_ARCH_BITS
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync * Defines the host architecture bit count.
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync#if !defined(HC_ARCH_BITS) || defined(DOXYGEN_RUNNING)
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync/** @def GC_ARCH_BITS
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Defines the guest architecture bit count.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync#if !defined(GC_ARCH_BITS) && !defined(DOXYGEN_RUNNING)
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync/** @def R3_ARCH_BITS
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Defines the host ring-3 architecture bit count.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync#if !defined(R3_ARCH_BITS) || defined(DOXYGEN_RUNNING)
f379f813372b948dc6603b556f0ade7f838a5a65vboxsync/** @def R0_ARCH_BITS
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Defines the host ring-0 architecture bit count.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync#if !defined(R0_ARCH_BITS) || defined(DOXYGEN_RUNNING)
f379f813372b948dc6603b556f0ade7f838a5a65vboxsync/** @def GC_ARCH_BITS
b7a5b3f9f9ecce32ddacf8404c625ce0451bbdc1vboxsync * Defines the guest architecture bit count.
fe813b3594039ba864493438e78ee0e7132bc445vboxsync#if !defined(GC_ARCH_BITS) || defined(DOXYGEN_RUNNING)
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync/** @def CTXTYPE
f379f813372b948dc6603b556f0ade7f838a5a65vboxsync * Declare a type differently in GC, R3 and R0.
b7a5b3f9f9ecce32ddacf8404c625ce0451bbdc1vboxsync * @param GCType The GC type.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param R3Type The R3 type.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param R0Type The R0 type.
f379f813372b948dc6603b556f0ade7f838a5a65vboxsync * @remark For pointers used only in one context use RCPTRTYPE(), R3R0PTRTYPE(), R3PTRTYPE() or R0PTRTYPE().
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync/** @def RCPTRTYPE
b1cc88518a7578ee20491f3d97b9792c24c6428dvboxsync * Declare a pointer which is used in the raw mode context but appears in structure(s) used by
fe813b3594039ba864493438e78ee0e7132bc445vboxsync * both HC and RC. The main purpose is to make sure structures have the same
b1cc88518a7578ee20491f3d97b9792c24c6428dvboxsync * size when built for different architectures.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param RCType The RC type.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync#define RCPTRTYPE(RCType) CTXTYPE(RCType, RTRCPTR, RTRCPTR)
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync/** @def R3R0PTRTYPE
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Declare a pointer which is used in HC, is explicitly valid in ring 3 and 0,
362838d79d234a41380be42aae9118850cc3c929vboxsync * but appears in structure(s) used by both HC and GC. The main purpose is to
362838d79d234a41380be42aae9118850cc3c929vboxsync * make sure structures have the same size when built for different architectures.
362838d79d234a41380be42aae9118850cc3c929vboxsync * @param R3R0Type The R3R0 type.
362838d79d234a41380be42aae9118850cc3c929vboxsync * @remarks This used to be called HCPTRTYPE.
bc36547e8dd3d35e5f756643a267bbe01e2c1d4cvboxsync#define R3R0PTRTYPE(R3R0Type) CTXTYPE(RTHCPTR, R3R0Type, R3R0Type)
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsync/** @def R3PTRTYPE
362838d79d234a41380be42aae9118850cc3c929vboxsync * Declare a pointer which is used in R3 but appears in structure(s) used by
362838d79d234a41380be42aae9118850cc3c929vboxsync * both HC and GC. The main purpose is to make sure structures have the same
362838d79d234a41380be42aae9118850cc3c929vboxsync * size when built for different architectures.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param R3Type The R3 type.
22bdb1ce26b2d5a41d1b071c16f1078e5348bb0dvboxsync#define R3PTRTYPE(R3Type) CTXTYPE(RTHCUINTPTR, R3Type, RTHCUINTPTR)
22bdb1ce26b2d5a41d1b071c16f1078e5348bb0dvboxsync/** @def R0PTRTYPE
22bdb1ce26b2d5a41d1b071c16f1078e5348bb0dvboxsync * Declare a pointer which is used in R0 but appears in structure(s) used by
22bdb1ce26b2d5a41d1b071c16f1078e5348bb0dvboxsync * both HC and GC. The main purpose is to make sure structures have the same
22bdb1ce26b2d5a41d1b071c16f1078e5348bb0dvboxsync * size when built for different architectures.
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsync * @param R0Type The R0 type.
22bdb1ce26b2d5a41d1b071c16f1078e5348bb0dvboxsync#define R0PTRTYPE(R0Type) CTXTYPE(RTHCUINTPTR, RTHCUINTPTR, R0Type)
22bdb1ce26b2d5a41d1b071c16f1078e5348bb0dvboxsync/** @def CTXSUFF
22bdb1ce26b2d5a41d1b071c16f1078e5348bb0dvboxsync * Adds the suffix of the current context to the passed in
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * identifier name. The suffix is HC or GC.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * This is macro should only be used in shared code to avoid a forest of ifdefs.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * @param var Identifier name.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * @deprecated Use CTX_SUFF. Do NOT use this for new code.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync/** @def OTHERCTXSUFF
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * Adds the suffix of the other context to the passed in
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * identifier name. The suffix is HC or GC.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * This is macro should only be used in shared code to avoid a forest of ifdefs.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * @param var Identifier name.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * @deprecated Use CTX_SUFF. Do NOT use this for new code.
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync/** @def CTXALLSUFF
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync * Adds the suffix of the current context to the passed in
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync * identifier name. The suffix is R3, R0 or GC.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * This is macro should only be used in shared code to avoid a forest of ifdefs.
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync * @param var Identifier name.
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync * @deprecated Use CTX_SUFF. Do NOT use this for new code.
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync/** @def CTX_SUFF
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * Adds the suffix of the current context to the passed in
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync * identifier name. The suffix is R3, R0 or RC.
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync * This is macro should only be used in shared code to avoid a forest of ifdefs.
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync * @param var Identifier name.
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync * @remark This will replace CTXALLSUFF and CTXSUFF before long.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync/** @def CTX_SUFF_Z
c28fa006ba669ad8f26ae31d00a338379c04ea1bvboxsync * Adds the suffix of the current context to the passed in
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * identifier name, combining RC and R0 into RZ.
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync * The suffix thus is R3 or RZ.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * This is macro should only be used in shared code to avoid a forest of ifdefs.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param var Identifier name.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @remark This will replace CTXALLSUFF and CTXSUFF before long.
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsync/** @def CTXMID
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsync * Adds the current context as a middle name of an identifier name
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsync * The middle name is HC or GC.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * This is macro should only be used in shared code to avoid a forest of ifdefs.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param first First name.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param last Surname.
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsync/** @def OTHERCTXMID
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync * Adds the other context as a middle name of an identifier name
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * The middle name is HC or GC.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * This is macro should only be used in shared code to avoid a forest of ifdefs.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param first First name.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param last Surname.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @deprecated use CTX_MID or CTX_MID_Z
801238b286a80a5dd67ba56a1f26c0bc98a2a1eavboxsync/** @def CTXALLMID
801238b286a80a5dd67ba56a1f26c0bc98a2a1eavboxsync * Adds the current context as a middle name of an identifier name.
801238b286a80a5dd67ba56a1f26c0bc98a2a1eavboxsync * The middle name is R3, R0 or GC.
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync * This is macro should only be used in shared code to avoid a forest of ifdefs.
801238b286a80a5dd67ba56a1f26c0bc98a2a1eavboxsync * @param first First name.
801238b286a80a5dd67ba56a1f26c0bc98a2a1eavboxsync * @param last Surname.
801238b286a80a5dd67ba56a1f26c0bc98a2a1eavboxsync * @deprecated use CTX_MID or CTX_MID_Z
fe96bc0e43d9c137304462ef8c2d79cbff22446fvboxsync/** @def CTX_MID
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync * Adds the current context as a middle name of an identifier name.
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync * The middle name is R3, R0 or RC.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * This is macro should only be used in shared code to avoid a forest of ifdefs.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param first First name.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param last Surname.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync/** @def CTX_MID_Z
ad77e3ec3cde24263bc7537575f5cae442bee3b1vboxsync * Adds the current context as a middle name of an identifier name, combining RC
ad77e3ec3cde24263bc7537575f5cae442bee3b1vboxsync * and R0 into RZ.
ad77e3ec3cde24263bc7537575f5cae442bee3b1vboxsync * The middle name thus is either R3 or RZ.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * This is macro should only be used in shared code to avoid a forest of ifdefs.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param first First name.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param last Surname.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync/** @def R3STRING
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * A macro which in GC and R0 will return a dummy string while in R3 it will return
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * the parameter.
ad77e3ec3cde24263bc7537575f5cae442bee3b1vboxsync * This is typically used to wrap description strings in structures shared
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * between R3, R0 and/or GC. The intention is to avoid the \#ifdef IN_RING3 mess.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param pR3String The R3 string. Only referenced in R3.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @see R0STRING and GCSTRING
cba6719bd64ec749967bbe931230452664109857vboxsync/** @def R0STRING
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * A macro which in GC and R3 will return a dummy string while in R0 it will return
ad77e3ec3cde24263bc7537575f5cae442bee3b1vboxsync * the parameter.
ad77e3ec3cde24263bc7537575f5cae442bee3b1vboxsync * This is typically used to wrap description strings in structures shared
cba6719bd64ec749967bbe931230452664109857vboxsync * between R3, R0 and/or GC. The intention is to avoid the \#ifdef IN_RING0 mess.
cba6719bd64ec749967bbe931230452664109857vboxsync * @param pR0String The R0 string. Only referenced in R0.
cba6719bd64ec749967bbe931230452664109857vboxsync * @see R3STRING and GCSTRING
#ifdef IN_RING0
#ifdef IN_RC
#define RT_NOTHING
#ifdef _MSC_VER
#elif defined(__GNUC__) && defined(IN_RING0) && !(defined(RT_OS_OS2) || defined(RT_ARCH_AMD64)) /* the latter is kernel/gcc */
# define RTCALL
#if defined(__cplusplus) \
# define RT_NO_THROW
#ifdef __cplusplus
# ifdef _MSC_VER
# ifdef _MSC_VER
#ifdef _MSC_VER
#ifdef _MSC_VER
#ifdef IN_RING3
#ifdef IN_RC
#ifdef IN_RING0
#ifdef __GNUC__
#ifdef __GNUC__
#ifdef __GNUC__
#ifdef IN_RT_R0
# ifdef IN_RT_STATIC
#ifdef IN_RT_R3
# ifdef IN_RT_STATIC
#ifdef IN_RT_GC
# ifdef IN_RT_STATIC
# ifdef IN_RT_STATIC
# ifdef IN_RT_STATIC
#ifndef RT_WITHOUT_NOCRT_WRAPPERS
#if defined(__GNUC__)
* @remark This macro is the preferred alignment macro, it doesn't have any of the pitfalls RT_ALIGN has.
#define RT_ALIGN_T(u, uAlignment, type) ( ((type)(u) + ((uAlignment) - 1)) & ~(type)((uAlignment) - 1) )
#define RT_UOFFSETOF_ADD(type, member, addend) ( (uintptr_t)&( ((type *)(void *)(uintptr_t)(addend))->member) )
#define RT_FROM_MEMBER(pMem, Type, Member) ( (Type *) ((uint8_t *)(void *)(pMem) + RT_UOFFSETOF(Type, Member)) )
#ifdef RT_OS_OS2
resource type define in os2.h. */
#define RT_BSWAP_U64_C(u64) RT_MAKE_U64(RT_BSWAP_U32_C((u64) >> 32), RT_BSWAP_U32_C((u64) & 0xffffffff))
#define RT_BSWAP_U32_C(u32) (RT_BYTE4(u32) | (RT_BYTE3(u32) << 8) | (RT_BYTE2(u32) << 16) | (RT_BYTE1(u32) << 24))
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#ifdef RT_BIG_ENDIAN
#if defined(RT_OS_DARWIN) \
&& !defined(KERNEL) \
&& !defined(RT_NO_BSD_PARAM_H_UNDEFING) \
#ifndef NULL
# ifdef __cplusplus
# define NULL 0
# define NULL ((void*)0)
#define NIL_OFFSET (~0U)
#ifdef __GNUC__
#ifdef _MSC_VER
#ifndef Breakpoint
#if defined(RT_ARCH_AMD64)
# ifdef IN_RING3
#define N_(s) (s)
#define _(s) gettext(s)
# define RT_STRICT
#ifdef __cplusplus
# define DECLEXPORT_CLASS
# define DECLIMPORT_CLASS
#if defined(_MSC_VER)
#if defined(_MSC_VER)