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