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