/*BEGIN_LEGAL Intel Open Source License Copyright (c) 2002-2005 Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. END_LEGAL */ /* ** ** @ORIGINAL_AUTHOR: Robert Muth */ /*! @file * * this headerfile contains defines the types that are the foundation of * other code * */ #ifndef TYPES_FOUNDATION_H #define TYPES_FOUNDATION_H #ifdef __cplusplus typedef bool BOOL; #else typedef unsigned char BOOL; #endif #define TRUE 1 #define FALSE 0 /* VOID is defined on winnt.h and winloader includes that */ #if !defined(VOID) typedef void VOID; #endif typedef char CHAR; #if !defined( __GNUC__) && defined(_WIN32) typedef unsigned __int8 UINT8 ; typedef unsigned __int16 UINT16; typedef unsigned __int32 UINT32; typedef unsigned __int64 UINT64; typedef __int8 INT8; typedef __int16 INT16; typedef __int32 INT32; typedef __int64 INT64; #else typedef uint8_t UINT8; //LINUX HOSTS typedef uint16_t UINT16; typedef uint32_t UINT32; typedef uint64_t UINT64; typedef int8_t INT8; typedef int16_t INT16; typedef int32_t INT32; typedef int64_t INT64; # endif typedef unsigned int UINT; typedef int INT; typedef double FLT64; typedef float FLT32; /* ** unsigned integer of the same size as a pointer on the TARGET architecture ** this quantity can be converted to and from an OADDR/IADDR */ #if defined(TARGET_IA32) typedef UINT32 ADDRINT; typedef INT32 ADDRDELTA; #elif defined(TARGET_IPF) || defined(TARGET_IA32E) typedef UINT64 ADDRINT; typedef INT64 ADDRDELTA; #elif defined(TARGET_DOXYGEN) /*! @ingroup TYPES_BASE An integer big enough to hold a pointer */ typedef xxx ADDRINT; typedef xxx ADDRDELTA; #else #error "wwwwwwwwwwwwwwwwwwwwwwwwwwww" #endif #if defined(HOST_IA32) typedef UINT32 VOIDINT; #elif defined(HOST_IPF) || defined(HOST_IA32E) typedef UINT64 VOIDINT; #else typedef ADDRINT VOIDINT; #endif /*! @ingroup TYPES_BASE Used to hold a size */ typedef unsigned int USIZE; typedef signed int SIZE; #ifdef __GNUC__ #define STRTOUINT64 strtoull #define STRTOINT64 strtoll #else #define STRTOUINT64 strtoul #define STRTOINT64 strtol #endif #define STRTOFLT64 strtod #define NIL ((void *) -1L) #define MAX(a, b) (((a)>(b))?(a) : (b)) #define MIN(a, b) (((a)<(b))?(a) : (b)) #endif