1 #ifndef __khrplatform_h_
2 #define __khrplatform_h_
93 #if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
94 # define KHRONOS_STATIC 1
102 #if defined(KHRONOS_STATIC)
105 # define KHRONOS_APICALL
106 #elif defined(_WIN32)
107 # define KHRONOS_APICALL __declspec(dllimport)
108 #elif defined (__SYMBIAN32__)
109 # define KHRONOS_APICALL IMPORT_C
110 #elif defined(__ANDROID__)
111 # define KHRONOS_APICALL __attribute__((visibility("default")))
113 # define KHRONOS_APICALL
122 #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
124 # define KHRONOS_APIENTRY __stdcall
126 # define KHRONOS_APIENTRY
134 #if defined (__ARMCC_2__)
135 #define KHRONOS_APIATTRIBUTES __softfp
137 #define KHRONOS_APIATTRIBUTES
143 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
150 typedef int32_t khronos_int32_t;
151 typedef uint32_t khronos_uint32_t;
152 typedef int64_t khronos_int64_t;
153 typedef uint64_t khronos_uint64_t;
154 #define KHRONOS_SUPPORT_INT64 1
155 #define KHRONOS_SUPPORT_FLOAT 1
165 #if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
166 #if __SIZEOF_POINTER__ > __SIZEOF_LONG__
167 #define KHRONOS_USE_INTPTR_T
171 #elif defined(__VMS ) || defined(__sgi)
176 #include <inttypes.h>
177 typedef int32_t khronos_int32_t;
178 typedef uint32_t khronos_uint32_t;
179 typedef int64_t khronos_int64_t;
180 typedef uint64_t khronos_uint64_t;
181 #define KHRONOS_SUPPORT_INT64 1
182 #define KHRONOS_SUPPORT_FLOAT 1
184 #elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
189 typedef __int32 khronos_int32_t;
190 typedef unsigned __int32 khronos_uint32_t;
191 typedef __int64 khronos_int64_t;
192 typedef unsigned __int64 khronos_uint64_t;
193 #define KHRONOS_SUPPORT_INT64 1
194 #define KHRONOS_SUPPORT_FLOAT 1
196 #elif defined(__sun__) || defined(__digital__)
201 typedef int khronos_int32_t;
202 typedef unsigned int khronos_uint32_t;
203 #if defined(__arch64__) || defined(_LP64)
204 typedef long int khronos_int64_t;
205 typedef unsigned long int khronos_uint64_t;
207 typedef long long int khronos_int64_t;
208 typedef unsigned long long int khronos_uint64_t;
210 #define KHRONOS_SUPPORT_INT64 1
211 #define KHRONOS_SUPPORT_FLOAT 1
218 typedef int khronos_int32_t;
219 typedef unsigned int khronos_uint32_t;
220 #define KHRONOS_SUPPORT_INT64 0
221 #define KHRONOS_SUPPORT_FLOAT 0
229 typedef int32_t khronos_int32_t;
230 typedef uint32_t khronos_uint32_t;
231 typedef int64_t khronos_int64_t;
232 typedef uint64_t khronos_uint64_t;
233 #define KHRONOS_SUPPORT_INT64 1
234 #define KHRONOS_SUPPORT_FLOAT 1
242 typedef signed char khronos_int8_t;
243 typedef unsigned char khronos_uint8_t;
244 typedef signed short int khronos_int16_t;
245 typedef unsigned short int khronos_uint16_t;
252 #ifdef KHRONOS_USE_INTPTR_T
253 typedef intptr_t khronos_intptr_t;
254 typedef uintptr_t khronos_uintptr_t;
255 #elif defined(_WIN64)
256 typedef signed long long int khronos_intptr_t;
257 typedef unsigned long long int khronos_uintptr_t;
259 typedef signed long int khronos_intptr_t;
260 typedef unsigned long int khronos_uintptr_t;
264 typedef signed long long int khronos_ssize_t;
265 typedef unsigned long long int khronos_usize_t;
267 typedef signed long int khronos_ssize_t;
268 typedef unsigned long int khronos_usize_t;
271 #if KHRONOS_SUPPORT_FLOAT
275 typedef float khronos_float_t;
278 #if KHRONOS_SUPPORT_INT64
288 typedef khronos_uint64_t khronos_utime_nanoseconds_t;
289 typedef khronos_int64_t khronos_stime_nanoseconds_t;
295 #ifndef KHRONOS_MAX_ENUM
296 #define KHRONOS_MAX_ENUM 0x7FFFFFFF
308 KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
309 } khronos_boolean_enum_t;