williamr@4: #ifndef __khrplatform_h_ williamr@4: #define __khrplatform_h_ williamr@4: williamr@4: /* $Revision$ on $Date:: $ */ williamr@4: williamr@4: /* williamr@4: ** Copyright (c) 2008 The Khronos Group Inc. williamr@4: ** williamr@4: ** Permission is hereby granted, free of charge, to any person obtaining a williamr@4: ** copy of this software and/or associated documentation files (the williamr@4: ** "Materials"), to deal in the Materials without restriction, including williamr@4: ** without limitation the rights to use, copy, modify, merge, publish, williamr@4: ** distribute, sublicense, and/or sell copies of the Materials, and to williamr@4: ** permit persons to whom the Materials are furnished to do so, subject to williamr@4: ** the following conditions: williamr@4: ** williamr@4: ** The above copyright notice and this permission notice shall be included williamr@4: ** in all copies or substantial portions of the Materials. williamr@4: ** williamr@4: ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, williamr@4: ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF williamr@4: ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. williamr@4: ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY williamr@4: ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, williamr@4: ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE williamr@4: ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. williamr@4: */ williamr@4: williamr@4: /* Platform-specific types and definitions. williamr@4: * Last modified on 2008/12/19 williamr@4: * williamr@4: * Adopters may modify this file to suit their platform. Adopters are williamr@4: * encouraged to submit platform specific modifications to the Khronos williamr@4: * group so that they can be included in future versions of this file. williamr@4: * Please submit changes by sending them to the public Khronos Bugzilla williamr@4: * (http://khronos.org/bugzilla) by filing a bug against product williamr@4: * "Khronos (general)" component "Registry". williamr@4: * williamr@4: * A predefined template which fills in some of the bug fields can be williamr@4: * reached using http://tinyurl.com/khrplatform-h-bugreport, but you williamr@4: * must create a Bugzilla login first. williamr@4: * williamr@4: * williamr@4: * williamr@4: * This file should be included as williamr@4: * #include williamr@4: * by the Khronos API header file that uses its types and defines. williamr@4: * williamr@4: * The types in this file should only be used to define API-specific types. williamr@4: * Types defined in this file: williamr@4: * khronos_int8_t signed 8 bit williamr@4: * khronos_uint8_t unsigned 8 bit williamr@4: * khronos_int16_t signed 16 bit williamr@4: * khronos_uint16_t unsigned 16 bit williamr@4: * khronos_int32_t signed 32 bit williamr@4: * khronos_uint32_t unsigned 32 bit williamr@4: * khronos_int64_t signed 64 bit williamr@4: * khronos_uint64_t unsigned 64 bit williamr@4: * khronos_intptr_t signed same number of bits as a pointer williamr@4: * khronos_uintptr_t unsigned same number of bits as a pointer williamr@4: * khronos_ssize_t signed size williamr@4: * khronos_usize_t unsigned size williamr@4: * khronos_float_t signed 32 bit floating point williamr@4: * khronos_time_ns_t unsigned 64 bit time in nanoseconds williamr@4: * khronos_utime_nanoseconds_t unsigned time interval or absolute time in williamr@4: * nanoseconds williamr@4: * khronos_stime_nanoseconds_t signed time interval in nanoseconds williamr@4: * williamr@4: * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. williamr@4: * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. williamr@4: * williamr@4: * williamr@4: * Macros defined in this file: williamr@4: * KHRONOS_APICALL williamr@4: * KHRONOS_APIENTRY williamr@4: * KHRONOS_APIATTRIBUTES williamr@4: * These may be used in function prototypes as: williamr@4: * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( williamr@4: * int arg1, williamr@4: * int arg2) KHRONOS_APIATTRIBUTES; williamr@4: */ williamr@4: williamr@4: #ifdef __cplusplus williamr@4: extern "C" { williamr@4: #endif williamr@4: williamr@4: #include williamr@4: williamr@4: /*------------------------------------------------------------------------- williamr@4: * Definition of KHRONOS_APICALL and KHRONOS_APIENTRY williamr@4: *-----------------------------------------------------------------------*/ williamr@4: williamr@4: #if defined(AEE_SIMULATOR) williamr@4: #define __KHR_EXPORTS williamr@4: #endif williamr@4: williamr@4: # if defined(_WIN32) || defined(__VC32__) || defined(__MWERKS__) || defined(__CW32__) /* Win32 */ williamr@4: # ifdef __KHR_EXPORTS williamr@4: # define KHRONOS_APICALL __declspec(dllexport) williamr@4: # else williamr@4: # define KHRONOS_APICALL __declspec(dllexport) williamr@4: # endif williamr@4: #else williamr@4: # if defined (__ARMCC_2_2__) williamr@4: # ifdef __KHR_EXPORTS williamr@4: # define KHRONOS_APICALL __declspec(dllexport) williamr@4: # else williamr@4: # define KHRONOS_APICALL __declspec(dllimport) williamr@4: # endif williamr@4: # elif (__ARMCC_VERSION >= 310000) williamr@4: # define KHRONOS_APICALL __declspec(dllimport) williamr@4: # else williamr@4: # ifdef __KHR_EXPORTS williamr@4: # define KHRONOS_APICALL williamr@4: # else williamr@4: # define KHRONOS_APICALL extern williamr@4: # endif williamr@4: # endif williamr@4: #endif williamr@4: williamr@4: #define KHRONOS_APIENTRY williamr@4: williamr@4: #ifndef APIENTRY williamr@4: # define APIENTRY KHRONOS_APIENTRY williamr@4: #endif williamr@4: williamr@4: #ifndef KHRAPI williamr@4: # define KHRAPI KHRONOS_APICALL williamr@4: #endif williamr@4: williamr@4: #if defined (__ARMCC_2__) williamr@4: #define KHRONOS_APIATTRIBUTES __softfp williamr@4: #else williamr@4: #define KHRONOS_APIATTRIBUTES williamr@4: #endif williamr@4: williamr@4: #define KHRONOS_SUPPORT_INT64 0 williamr@4: #define KHRONOS_SUPPORT_FLOAT 0 williamr@4: williamr@4: typedef TReal32 khronos_float; // float williamr@4: typedef TReal32 khronos_float_t; // float williamr@4: typedef TInt8 khronos_int8_t; // signed char williamr@4: typedef TUint8 khronos_uint8_t; // unsigned char williamr@4: typedef TInt16 khronos_int16_t; // short int williamr@4: typedef TUint16 khronos_uint16_t; // unsigned short int williamr@4: typedef TInt32 khronos_int32_t; // long int williamr@4: typedef TUint32 khronos_uint32_t; // unsigned long int williamr@4: typedef TInt64 khronos_int64_t; // long int williamr@4: typedef TUint64 khronos_uint64_t; // unsigned long int williamr@4: williamr@4: typedef TUint64 khronos_utime_nanoseconds_t; williamr@4: typedef TInt32 khronos_stime_nanoseconds_t; williamr@4: williamr@4: #ifdef __cplusplus williamr@4: } williamr@4: #endif williamr@4: williamr@4: /* williamr@4: * Platform definition of TRUE and FALSE williamr@4: */ williamr@4: #define KHR_BOOLEAN_TRUE (0 == 0) williamr@4: #define KHR_BOOLEAN_FALSE (0 != 0) williamr@4: williamr@4: #endif /* __khrplatform_h_ */