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