Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright 2006-2007 Advanced Micro Devices, Inc.  
  3.  *
  4.  * Permission is hereby granted, free of charge, to any person obtaining a
  5.  * copy of this software and associated documentation files (the "Software"),
  6.  * to deal in the Software without restriction, including without limitation
  7.  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8.  * and/or sell copies of the Software, and to permit persons to whom the
  9.  * Software is furnished to do so, subject to the following conditions:
  10.  *
  11.  * The above copyright notice and this permission notice shall be included in
  12.  * all copies or substantial portions of the Software.
  13.  *
  14.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  17.  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18.  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19.  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20.  * OTHER DEALINGS IN THE SOFTWARE.
  21.  */
  22.  
  23. /*++
  24.  
  25. Module Name:
  26.  
  27.     CD_Common_Types.h
  28.    
  29. Abstract:
  30.  
  31.                 Defines common data types to use across platforms/SW components
  32.  
  33. Revision History:
  34.  
  35.         NEG:17.09.2002  Initiated.
  36. --*/
  37. #ifndef _COMMON_TYPES_H_
  38.         #define _COMMON_TYPES_H_
  39.  
  40.     #ifndef LINUX
  41.         #if _MSC_EXTENSIONS
  42.    
  43.     //
  44.     // use Microsoft* C complier dependent interger width types
  45.     //
  46.         //    typedef unsigned __int64    uint64_t;
  47.         //    typedef __int64             int64_t;
  48.                 typedef unsigned __int32    uint32_t;
  49.                 typedef __int32             int32_t;
  50. #elif defined (__linux__) || defined (__NetBSD__) \
  51.     || defined(__sun) || defined(__OpenBSD__) \
  52.     || defined (__FreeBSD__) || defined(__DragonFly__) || defined(__GLIBC__)
  53.                 typedef unsigned int uint32_t;
  54.                 typedef int int32_t;
  55.         #else
  56.                 typedef unsigned long       uint32_t;
  57.                 typedef signed long         int32_t;
  58.         #endif
  59.                 typedef unsigned char       uint8_t;
  60. #if (defined(__sun) && defined(_CHAR_IS_SIGNED))
  61.                 typedef char                int8_t;
  62. #else
  63.                 typedef signed char         int8_t;
  64. #endif
  65.                 typedef unsigned short      uint16_t;
  66.                 typedef signed short        int16_t;
  67.         #endif
  68. #ifndef UEFI_BUILD
  69.                 typedef signed int                      intn_t;
  70.                 typedef unsigned int            uintn_t;
  71. #else
  72. #ifndef EFIX64
  73.                 typedef signed int                      intn_t;
  74.                 typedef unsigned int            uintn_t;
  75. #endif
  76. #endif
  77. #ifndef FGL_LINUX
  78. #pragma warning ( disable : 4142 )
  79. #endif
  80.  
  81.  
  82. #ifndef VOID
  83. typedef void            VOID;
  84. #endif
  85. #ifndef UEFI_BUILD
  86.         typedef intn_t          INTN;
  87.         typedef uintn_t         UINTN;
  88. #else
  89. #ifndef EFIX64
  90.         typedef intn_t          INTN;
  91.         typedef uintn_t         UINTN;
  92. #endif
  93. #endif
  94. #ifndef BOOLEAN
  95. typedef uint8_t         BOOLEAN;
  96. #endif
  97. #ifndef INT8
  98. typedef int8_t          INT8;
  99. #endif
  100. #ifndef UINT8
  101. typedef uint8_t         UINT8;
  102. #endif
  103. #ifndef INT16
  104. typedef int16_t         INT16;
  105. #endif
  106. #ifndef UINT16
  107. typedef uint16_t        UINT16;
  108. #endif
  109. #ifndef INT32
  110. typedef int32_t         INT32;
  111. #endif
  112. #ifndef UINT32
  113. typedef uint32_t        UINT32;
  114. #endif
  115. //typedef int64_t   INT64;
  116. //typedef uint64_t  UINT64;
  117. typedef uint8_t         CHAR8;
  118. typedef uint16_t        CHAR16;
  119. #ifndef USHORT
  120. typedef UINT16          USHORT;
  121. #endif
  122. #ifndef UCHAR
  123. typedef UINT8           UCHAR;
  124. #endif
  125. #ifndef ULONG
  126. typedef UINT32          ULONG;
  127. #endif
  128.  
  129. #ifndef _WIN64
  130. #ifndef ULONG_PTR
  131. typedef unsigned long ULONG_PTR;
  132. #endif // ULONG_PTR
  133. #endif // _WIN64
  134.  
  135. //#define       FAR     __far
  136. #ifndef TRUE
  137.   #define TRUE  ((BOOLEAN) 1 == 1)
  138. #endif
  139.  
  140. #ifndef FALSE
  141.   #define FALSE ((BOOLEAN) 0 == 1)
  142. #endif
  143.  
  144. #ifndef NULL
  145.   #define NULL  ((VOID *) 0)
  146. #endif
  147.  
  148. //typedef       UINTN           CD_STATUS;
  149.  
  150.  
  151. #ifndef FGL_LINUX
  152. #pragma warning ( default : 4142 )
  153. #endif
  154. #endif // _COMMON_TYPES_H_
  155.  
  156. // EOF
  157.