1 #ifndef __khrplatform_h_
2 #define __khrplatform_h_
4 /* $Revision$ on $Date:: $ */
7 ** Copyright (c) 2008 The Khronos Group Inc.
9 ** Permission is hereby granted, free of charge, to any person obtaining a
10 ** copy of this software and/or associated documentation files (the
11 ** "Materials"), to deal in the Materials without restriction, including
12 ** without limitation the rights to use, copy, modify, merge, publish,
13 ** distribute, sublicense, and/or sell copies of the Materials, and to
14 ** permit persons to whom the Materials are furnished to do so, subject to
15 ** the following conditions:
17 ** The above copyright notice and this permission notice shall be included
18 ** in all copies or substantial portions of the Materials.
20 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
29 /* Platform-specific types and definitions.
30 * Last modified on 2008/12/19
32 * Adopters may modify this file to suit their platform. Adopters are
33 * encouraged to submit platform specific modifications to the Khronos
34 * group so that they can be included in future versions of this file.
35 * Please submit changes by sending them to the public Khronos Bugzilla
36 * (http://khronos.org/bugzilla) by filing a bug against product
37 * "Khronos (general)" component "Registry".
39 * A predefined template which fills in some of the bug fields can be
40 * reached using http://tinyurl.com/khrplatform-h-bugreport, but you
41 * must create a Bugzilla login first.
45 * This file should be included as
46 * #include <KHR/khrplatform.h>
47 * by the Khronos API header file that uses its types and defines.
49 * The types in this file should only be used to define API-specific types.
50 * Types defined in this file:
51 * khronos_int8_t signed 8 bit
52 * khronos_uint8_t unsigned 8 bit
53 * khronos_int16_t signed 16 bit
54 * khronos_uint16_t unsigned 16 bit
55 * khronos_int32_t signed 32 bit
56 * khronos_uint32_t unsigned 32 bit
57 * khronos_int64_t signed 64 bit
58 * khronos_uint64_t unsigned 64 bit
59 * khronos_intptr_t signed same number of bits as a pointer
60 * khronos_uintptr_t unsigned same number of bits as a pointer
61 * khronos_ssize_t signed size
62 * khronos_usize_t unsigned size
63 * khronos_float_t signed 32 bit floating point
64 * khronos_time_ns_t unsigned 64 bit time in nanoseconds
65 * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
67 * khronos_stime_nanoseconds_t signed time interval in nanoseconds
69 * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
70 * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
73 * Macros defined in this file:
76 * KHRONOS_APIATTRIBUTES
77 * These may be used in function prototypes as:
78 * KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
80 * int arg2) KHRONOS_APIATTRIBUTES;
89 /*-------------------------------------------------------------------------
90 * Definition of KHRONOS_APICALL and KHRONOS_APIENTRY
91 *-----------------------------------------------------------------------*/
93 #if defined(AEE_SIMULATOR)
97 # if defined(_WIN32) || defined(__VC32__) || defined(__MWERKS__) || defined(__CW32__) /* Win32 */
99 # define KHRONOS_APICALL __declspec(dllexport)
101 # define KHRONOS_APICALL __declspec(dllexport)
104 # if defined (__ARMCC_2_2__)
105 # ifdef __KHR_EXPORTS
106 # define KHRONOS_APICALL __declspec(dllexport)
108 # define KHRONOS_APICALL __declspec(dllimport)
110 # elif (__ARMCC_VERSION >= 310000)
111 # define KHRONOS_APICALL __declspec(dllimport)
113 # ifdef __KHR_EXPORTS
114 # define KHRONOS_APICALL
116 # define KHRONOS_APICALL extern
121 #define KHRONOS_APIENTRY
124 # define APIENTRY KHRONOS_APIENTRY
128 # define KHRAPI KHRONOS_APICALL
131 #if defined (__ARMCC_2__)
132 #define KHRONOS_APIATTRIBUTES __softfp
134 #define KHRONOS_APIATTRIBUTES
137 #define KHRONOS_SUPPORT_INT64 0
138 #define KHRONOS_SUPPORT_FLOAT 0
140 typedef TReal32 khronos_float; // float
141 typedef TReal32 khronos_float_t; // float
142 typedef TInt8 khronos_int8_t; // signed char
143 typedef TUint8 khronos_uint8_t; // unsigned char
144 typedef TInt16 khronos_int16_t; // short int
145 typedef TUint16 khronos_uint16_t; // unsigned short int
146 typedef TInt32 khronos_int32_t; // long int
147 typedef TUint32 khronos_uint32_t; // unsigned long int
148 typedef TInt64 khronos_int64_t; // long int
149 typedef TUint64 khronos_uint64_t; // unsigned long int
151 typedef TUint64 khronos_utime_nanoseconds_t;
152 typedef TInt32 khronos_stime_nanoseconds_t;
159 * Platform definition of TRUE and FALSE
161 #define KHR_BOOLEAN_TRUE (0 == 0)
162 #define KHR_BOOLEAN_FALSE (0 != 0)
164 #endif /* __khrplatform_h_ */