epoc32/include/KHR/khrplatform.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/KHR/khrplatform.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,164 @@
     1.4 +#ifndef __khrplatform_h_
     1.5 +#define __khrplatform_h_
     1.6 +
     1.7 +/* $Revision$ on $Date::   $ */
     1.8 +
     1.9 +/*
    1.10 +** Copyright (c) 2008 The Khronos Group Inc.
    1.11 +**
    1.12 +** Permission is hereby granted, free of charge, to any person obtaining a
    1.13 +** copy of this software and/or associated documentation files (the
    1.14 +** "Materials"), to deal in the Materials without restriction, including
    1.15 +** without limitation the rights to use, copy, modify, merge, publish,
    1.16 +** distribute, sublicense, and/or sell copies of the Materials, and to
    1.17 +** permit persons to whom the Materials are furnished to do so, subject to
    1.18 +** the following conditions:
    1.19 +**
    1.20 +** The above copyright notice and this permission notice shall be included
    1.21 +** in all copies or substantial portions of the Materials.
    1.22 +**
    1.23 +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    1.24 +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    1.25 +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    1.26 +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    1.27 +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    1.28 +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    1.29 +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
    1.30 +*/
    1.31 +
    1.32 +/* Platform-specific types and definitions.
    1.33 + * Last modified on 2008/12/19
    1.34 + * 
    1.35 + * Adopters may modify this file to suit their platform. Adopters are
    1.36 + * encouraged to submit platform specific modifications to the Khronos
    1.37 + * group so that they can be included in future versions of this file.
    1.38 + * Please submit changes by sending them to the public Khronos Bugzilla
    1.39 + * (http://khronos.org/bugzilla) by filing a bug against product
    1.40 + * "Khronos (general)" component "Registry".
    1.41 + *
    1.42 + * A predefined template which fills in some of the bug fields can be
    1.43 + * reached using http://tinyurl.com/khrplatform-h-bugreport, but you
    1.44 + * must create a Bugzilla login first.
    1.45 + * 
    1.46 + *
    1.47 + *
    1.48 + * This file should be included as
    1.49 + *        #include <KHR/khrplatform.h>
    1.50 + * by the Khronos API header file that uses its types and defines.
    1.51 + *
    1.52 + * The types in this file should only be used to define API-specific types.
    1.53 + * Types defined in this file:
    1.54 + *    khronos_int8_t              signed   8  bit
    1.55 + *    khronos_uint8_t             unsigned 8  bit
    1.56 + *    khronos_int16_t             signed   16 bit
    1.57 + *    khronos_uint16_t            unsigned 16 bit
    1.58 + *    khronos_int32_t             signed   32 bit
    1.59 + *    khronos_uint32_t            unsigned 32 bit
    1.60 + *    khronos_int64_t             signed   64 bit
    1.61 + *    khronos_uint64_t            unsigned 64 bit
    1.62 + *    khronos_intptr_t            signed   same number of bits as a pointer
    1.63 + *    khronos_uintptr_t           unsigned same number of bits as a pointer
    1.64 + *    khronos_ssize_t             signed   size
    1.65 + *    khronos_usize_t             unsigned size
    1.66 + *    khronos_float_t             signed   32 bit floating point
    1.67 + *    khronos_time_ns_t           unsigned 64 bit time in nanoseconds
    1.68 + *    khronos_utime_nanoseconds_t unsigned time interval or absolute time in
    1.69 + *                                         nanoseconds
    1.70 + *    khronos_stime_nanoseconds_t signed time interval in nanoseconds
    1.71 + *
    1.72 + * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
    1.73 + * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
    1.74 + * 
    1.75 + *
    1.76 + * Macros defined in this file:
    1.77 + *    KHRONOS_APICALL
    1.78 + *    KHRONOS_APIENTRY
    1.79 + *    KHRONOS_APIATTRIBUTES
    1.80 + * These may be used in function prototypes as:
    1.81 + *      KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
    1.82 + *                                  int arg1,
    1.83 + *                                  int arg2) KHRONOS_APIATTRIBUTES;
    1.84 + */
    1.85 +
    1.86 +#ifdef __cplusplus
    1.87 +extern "C" {
    1.88 +#endif
    1.89 +
    1.90 +#include <e32def.h>
    1.91 +
    1.92 +/*-------------------------------------------------------------------------
    1.93 + * Definition of KHRONOS_APICALL and KHRONOS_APIENTRY
    1.94 + *-----------------------------------------------------------------------*/
    1.95 +
    1.96 +#if defined(AEE_SIMULATOR)
    1.97 +#define __KHR_EXPORTS
    1.98 +#endif
    1.99 +
   1.100 +#   if defined(_WIN32) || defined(__VC32__) || defined(__MWERKS__) || defined(__CW32__)         /* Win32 */
   1.101 +#   ifdef __KHR_EXPORTS
   1.102 +#       define KHRONOS_APICALL __declspec(dllexport)
   1.103 +#   else
   1.104 +#       define KHRONOS_APICALL __declspec(dllexport)
   1.105 +#   endif
   1.106 +#else
   1.107 +#   if defined (__ARMCC_2_2__)
   1.108 +#   	ifdef __KHR_EXPORTS
   1.109 +#	    	define KHRONOS_APICALL __declspec(dllexport)
   1.110 +#   	else
   1.111 +#	    	define KHRONOS_APICALL __declspec(dllimport)
   1.112 +#   	endif
   1.113 +#   elif (__ARMCC_VERSION >= 310000)
   1.114 +#	    define KHRONOS_APICALL __declspec(dllimport)
   1.115 +#   else
   1.116 +#   	ifdef __KHR_EXPORTS
   1.117 +#           define KHRONOS_APICALL
   1.118 +#   	else
   1.119 +#           define KHRONOS_APICALL extern
   1.120 +#		endif
   1.121 +#   endif
   1.122 +#endif
   1.123 +
   1.124 +#define KHRONOS_APIENTRY
   1.125 +
   1.126 +#ifndef APIENTRY
   1.127 +#   define APIENTRY KHRONOS_APIENTRY
   1.128 +#endif
   1.129 +
   1.130 +#ifndef KHRAPI
   1.131 +#	define KHRAPI KHRONOS_APICALL
   1.132 +#endif
   1.133 +
   1.134 +#if defined (__ARMCC_2__)
   1.135 +#define KHRONOS_APIATTRIBUTES __softfp
   1.136 +#else
   1.137 +#define KHRONOS_APIATTRIBUTES
   1.138 +#endif
   1.139 +
   1.140 +#define KHRONOS_SUPPORT_INT64   0
   1.141 +#define KHRONOS_SUPPORT_FLOAT   0
   1.142 +
   1.143 +typedef TReal32 khronos_float;    // float
   1.144 +typedef TReal32 khronos_float_t;    // float
   1.145 +typedef TInt8   khronos_int8_t;   // signed char
   1.146 +typedef TUint8  khronos_uint8_t;  // unsigned char
   1.147 +typedef TInt16  khronos_int16_t;  // short int
   1.148 +typedef TUint16 khronos_uint16_t; // unsigned short int
   1.149 +typedef TInt32  khronos_int32_t;  // long int
   1.150 +typedef TUint32 khronos_uint32_t; // unsigned long int
   1.151 +typedef TInt64  khronos_int64_t;  // long int
   1.152 +typedef TUint64 khronos_uint64_t; // unsigned long int
   1.153 +
   1.154 +typedef TUint64	khronos_utime_nanoseconds_t;
   1.155 +typedef TInt32	khronos_stime_nanoseconds_t;
   1.156 +
   1.157 +#ifdef __cplusplus
   1.158 +}
   1.159 +#endif
   1.160 +
   1.161 +/*
   1.162 + * Platform definition of TRUE and FALSE
   1.163 + */
   1.164 +#define KHR_BOOLEAN_TRUE    (0 == 0)
   1.165 +#define KHR_BOOLEAN_FALSE    (0 != 0)
   1.166 +
   1.167 +#endif /* __khrplatform_h_ */