khrplatform.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /****************************************************************************
  2. *
  3. * Copyright (c) 2005 - 2010 by Vivante Corp. All rights reserved.
  4. *
  5. * The material in this file is confidential and contains trade secrets
  6. * of Vivante Corporation. This is proprietary information owned by
  7. * Vivante Corporation. No part of this work may be disclosed,
  8. * reproduced, copied, transmitted, or used in any way for any purpose,
  9. * without the express written permission of Vivante Corporation.
  10. *
  11. *****************************************************************************
  12. *
  13. * Auto-generated file on 4/22/2010. Do not edit!!!
  14. *
  15. *****************************************************************************/
  16. #ifndef __khrplatform_h_
  17. #define __khrplatform_h_
  18. /*
  19. ** Copyright (c) 2008-2009 The Khronos Group Inc.
  20. **
  21. ** Permission is hereby granted, free of charge, to any person obtaining a
  22. ** copy of this software and/or associated documentation files (the
  23. ** "Materials"), to deal in the Materials without restriction, including
  24. ** without limitation the rights to use, copy, modify, merge, publish,
  25. ** distribute, sublicense, and/or sell copies of the Materials, and to
  26. ** permit persons to whom the Materials are furnished to do so, subject to
  27. ** the following conditions:
  28. **
  29. ** The above copyright notice and this permission notice shall be included
  30. ** in all copies or substantial portions of the Materials.
  31. **
  32. ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  33. ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  34. ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  35. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  36. ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  37. ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  38. ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
  39. */
  40. /*-------------------------------------------------------------------------
  41. * Definition of KHRONOS_APICALL
  42. *-------------------------------------------------------------------------
  43. * This precedes the return type of the function in the function prototype.
  44. */
  45. #if defined(_WIN32) && !defined(__SCITECH_SNAP__)
  46. # define KHRONOS_APICALL __declspec(dllimport)
  47. #elif defined (__SYMBIAN32__)
  48. # define KHRONOS_APICALL IMPORT_C
  49. #else
  50. # define KHRONOS_APICALL
  51. #endif
  52. /*-------------------------------------------------------------------------
  53. * Definition of KHRONOS_APIENTRY
  54. *-------------------------------------------------------------------------
  55. * This follows the return type of the function and precedes the function
  56. * name in the function prototype.
  57. */
  58. #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
  59. /* Win32 but not WinCE */
  60. # define KHRONOS_APIENTRY __cdecl
  61. #else
  62. # define KHRONOS_APIENTRY
  63. #endif
  64. /*-------------------------------------------------------------------------
  65. * Definition of KHRONOS_APIATTRIBUTES
  66. *-------------------------------------------------------------------------
  67. * This follows the closing parenthesis of the function prototype arguments.
  68. */
  69. #if defined (__ARMCC_2__)
  70. #define KHRONOS_APIATTRIBUTES __softfp
  71. #else
  72. #define KHRONOS_APIATTRIBUTES
  73. #endif
  74. /*-------------------------------------------------------------------------
  75. * basic type definitions
  76. *-----------------------------------------------------------------------*/
  77. #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
  78. /*
  79. * Using <stdint.h>
  80. */
  81. #include <stdint.h>
  82. typedef int32_t khronos_int32_t;
  83. typedef uint32_t khronos_uint32_t;
  84. typedef int64_t khronos_int64_t;
  85. typedef uint64_t khronos_uint64_t;
  86. #define KHRONOS_SUPPORT_INT64 1
  87. #define KHRONOS_SUPPORT_FLOAT 1
  88. #elif defined(__VMS ) || defined(__sgi)
  89. /*
  90. * Using <inttypes.h>
  91. */
  92. #include <inttypes.h>
  93. typedef int32_t khronos_int32_t;
  94. typedef uint32_t khronos_uint32_t;
  95. typedef int64_t khronos_int64_t;
  96. typedef uint64_t khronos_uint64_t;
  97. #define KHRONOS_SUPPORT_INT64 1
  98. #define KHRONOS_SUPPORT_FLOAT 1
  99. #elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
  100. /*
  101. * Win32
  102. */
  103. typedef __int32 khronos_int32_t;
  104. typedef unsigned __int32 khronos_uint32_t;
  105. typedef __int64 khronos_int64_t;
  106. typedef unsigned __int64 khronos_uint64_t;
  107. #define KHRONOS_SUPPORT_INT64 1
  108. #define KHRONOS_SUPPORT_FLOAT 1
  109. #elif defined(__sun__) || defined(__digital__)
  110. /*
  111. * Sun or Digital
  112. */
  113. typedef int khronos_int32_t;
  114. typedef unsigned int khronos_uint32_t;
  115. #if defined(__arch64__) || defined(_LP64)
  116. typedef long int khronos_int64_t;
  117. typedef unsigned long int khronos_uint64_t;
  118. #else
  119. typedef long long int khronos_int64_t;
  120. typedef unsigned long long int khronos_uint64_t;
  121. #endif /* __arch64__ */
  122. #define KHRONOS_SUPPORT_INT64 1
  123. #define KHRONOS_SUPPORT_FLOAT 1
  124. #elif 0
  125. /*
  126. * Hypothetical platform with no float or int64 support
  127. */
  128. typedef int khronos_int32_t;
  129. typedef unsigned int khronos_uint32_t;
  130. #define KHRONOS_SUPPORT_INT64 0
  131. #define KHRONOS_SUPPORT_FLOAT 0
  132. #else
  133. /*
  134. * Generic fallback
  135. */
  136. #include <stdint.h>
  137. typedef int32_t khronos_int32_t;
  138. typedef uint32_t khronos_uint32_t;
  139. typedef int64_t khronos_int64_t;
  140. typedef uint64_t khronos_uint64_t;
  141. #define KHRONOS_SUPPORT_INT64 1
  142. #define KHRONOS_SUPPORT_FLOAT 1
  143. #endif
  144. /*
  145. * Types that are (so far) the same on all platforms
  146. */
  147. typedef signed char khronos_int8_t;
  148. typedef unsigned char khronos_uint8_t;
  149. typedef signed short int khronos_int16_t;
  150. typedef unsigned short int khronos_uint16_t;
  151. typedef signed long int khronos_intptr_t;
  152. typedef unsigned long int khronos_uintptr_t;
  153. typedef signed long int khronos_ssize_t;
  154. typedef unsigned long int khronos_usize_t;
  155. #if KHRONOS_SUPPORT_FLOAT
  156. /*
  157. * Float type
  158. */
  159. typedef float khronos_float_t;
  160. #endif
  161. #if KHRONOS_SUPPORT_INT64
  162. /* Time types
  163. *
  164. * These types can be used to represent a time interval in nanoseconds or
  165. * an absolute Unadjusted System Time. Unadjusted System Time is the number
  166. * of nanoseconds since some arbitrary system event (e.g. since the last
  167. * time the system booted). The Unadjusted System Time is an unsigned
  168. * 64 bit value that wraps back to 0 every 584 years. Time intervals
  169. * may be either signed or unsigned.
  170. */
  171. typedef khronos_uint64_t khronos_utime_nanoseconds_t;
  172. typedef khronos_int64_t khronos_stime_nanoseconds_t;
  173. #endif
  174. #endif /* __khrplatform_h_ */