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