gfx/angle/include/KHR/khrplatform.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/angle/include/KHR/khrplatform.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,269 @@
     1.4 +#ifndef __khrplatform_h_
     1.5 +#define __khrplatform_h_
     1.6 +
     1.7 +/*
     1.8 +** Copyright (c) 2008-2009 The Khronos Group Inc.
     1.9 +**
    1.10 +** Permission is hereby granted, free of charge, to any person obtaining a
    1.11 +** copy of this software and/or associated documentation files (the
    1.12 +** "Materials"), to deal in the Materials without restriction, including
    1.13 +** without limitation the rights to use, copy, modify, merge, publish,
    1.14 +** distribute, sublicense, and/or sell copies of the Materials, and to
    1.15 +** permit persons to whom the Materials are furnished to do so, subject to
    1.16 +** the following conditions:
    1.17 +**
    1.18 +** The above copyright notice and this permission notice shall be included
    1.19 +** in all copies or substantial portions of the Materials.
    1.20 +**
    1.21 +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    1.22 +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    1.23 +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    1.24 +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    1.25 +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    1.26 +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    1.27 +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
    1.28 +*/
    1.29 +
    1.30 +/* Khronos platform-specific types and definitions.
    1.31 + *
    1.32 + * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
    1.33 + *
    1.34 + * Adopters may modify this file to suit their platform. Adopters are
    1.35 + * encouraged to submit platform specific modifications to the Khronos
    1.36 + * group so that they can be included in future versions of this file.
    1.37 + * Please submit changes by sending them to the public Khronos Bugzilla
    1.38 + * (http://khronos.org/bugzilla) by filing a bug against product
    1.39 + * "Khronos (general)" component "Registry".
    1.40 + *
    1.41 + * A predefined template which fills in some of the bug fields can be
    1.42 + * reached using http://tinyurl.com/khrplatform-h-bugreport, but you
    1.43 + * must create a Bugzilla login first.
    1.44 + *
    1.45 + *
    1.46 + * See the Implementer's Guidelines for information about where this file
    1.47 + * should be located on your system and for more details of its use:
    1.48 + *    http://www.khronos.org/registry/implementers_guide.pdf
    1.49 + *
    1.50 + * This file should be included as
    1.51 + *        #include <KHR/khrplatform.h>
    1.52 + * by Khronos client API header files that use its types and defines.
    1.53 + *
    1.54 + * The types in khrplatform.h should only be used to define API-specific types.
    1.55 + *
    1.56 + * Types defined in khrplatform.h:
    1.57 + *    khronos_int8_t              signed   8  bit
    1.58 + *    khronos_uint8_t             unsigned 8  bit
    1.59 + *    khronos_int16_t             signed   16 bit
    1.60 + *    khronos_uint16_t            unsigned 16 bit
    1.61 + *    khronos_int32_t             signed   32 bit
    1.62 + *    khronos_uint32_t            unsigned 32 bit
    1.63 + *    khronos_int64_t             signed   64 bit
    1.64 + *    khronos_uint64_t            unsigned 64 bit
    1.65 + *    khronos_intptr_t            signed   same number of bits as a pointer
    1.66 + *    khronos_uintptr_t           unsigned same number of bits as a pointer
    1.67 + *    khronos_ssize_t             signed   size
    1.68 + *    khronos_usize_t             unsigned size
    1.69 + *    khronos_float_t             signed   32 bit floating point
    1.70 + *    khronos_time_ns_t           unsigned 64 bit time in nanoseconds
    1.71 + *    khronos_utime_nanoseconds_t unsigned time interval or absolute time in
    1.72 + *                                         nanoseconds
    1.73 + *    khronos_stime_nanoseconds_t signed time interval in nanoseconds
    1.74 + *    khronos_boolean_enum_t      enumerated boolean type. This should
    1.75 + *      only be used as a base type when a client API's boolean type is
    1.76 + *      an enum. Client APIs which use an integer or other type for
    1.77 + *      booleans cannot use this as the base type for their boolean.
    1.78 + *
    1.79 + * Tokens defined in khrplatform.h:
    1.80 + *
    1.81 + *    KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
    1.82 + *
    1.83 + *    KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
    1.84 + *    KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
    1.85 + *
    1.86 + * Calling convention macros defined in this file:
    1.87 + *    KHRONOS_APICALL
    1.88 + *    KHRONOS_APIENTRY
    1.89 + *    KHRONOS_APIATTRIBUTES
    1.90 + *
    1.91 + * These may be used in function prototypes as:
    1.92 + *
    1.93 + *      KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
    1.94 + *                                  int arg1,
    1.95 + *                                  int arg2) KHRONOS_APIATTRIBUTES;
    1.96 + */
    1.97 +
    1.98 +/*-------------------------------------------------------------------------
    1.99 + * Definition of KHRONOS_APICALL
   1.100 + *-------------------------------------------------------------------------
   1.101 + * This precedes the return type of the function in the function prototype.
   1.102 + */
   1.103 +#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
   1.104 +#   define KHRONOS_APICALL __declspec(dllimport)
   1.105 +#elif defined (__SYMBIAN32__)
   1.106 +#   define KHRONOS_APICALL IMPORT_C
   1.107 +#else
   1.108 +#   define KHRONOS_APICALL
   1.109 +#endif
   1.110 +
   1.111 +/*-------------------------------------------------------------------------
   1.112 + * Definition of KHRONOS_APIENTRY
   1.113 + *-------------------------------------------------------------------------
   1.114 + * This follows the return type of the function  and precedes the function
   1.115 + * name in the function prototype.
   1.116 + */
   1.117 +#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
   1.118 +    /* Win32 but not WinCE */
   1.119 +#   define KHRONOS_APIENTRY __stdcall
   1.120 +#else
   1.121 +#   define KHRONOS_APIENTRY
   1.122 +#endif
   1.123 +
   1.124 +/*-------------------------------------------------------------------------
   1.125 + * Definition of KHRONOS_APIATTRIBUTES
   1.126 + *-------------------------------------------------------------------------
   1.127 + * This follows the closing parenthesis of the function prototype arguments.
   1.128 + */
   1.129 +#if defined (__ARMCC_2__)
   1.130 +#define KHRONOS_APIATTRIBUTES __softfp
   1.131 +#else
   1.132 +#define KHRONOS_APIATTRIBUTES
   1.133 +#endif
   1.134 +
   1.135 +/*-------------------------------------------------------------------------
   1.136 + * basic type definitions
   1.137 + *-----------------------------------------------------------------------*/
   1.138 +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
   1.139 +
   1.140 +
   1.141 +/*
   1.142 + * Using <stdint.h>
   1.143 + */
   1.144 +#include <stdint.h>
   1.145 +typedef int32_t                 khronos_int32_t;
   1.146 +typedef uint32_t                khronos_uint32_t;
   1.147 +typedef int64_t                 khronos_int64_t;
   1.148 +typedef uint64_t                khronos_uint64_t;
   1.149 +#define KHRONOS_SUPPORT_INT64   1
   1.150 +#define KHRONOS_SUPPORT_FLOAT   1
   1.151 +
   1.152 +#elif defined(__VMS ) || defined(__sgi)
   1.153 +
   1.154 +/*
   1.155 + * Using <inttypes.h>
   1.156 + */
   1.157 +#include <inttypes.h>
   1.158 +typedef int32_t                 khronos_int32_t;
   1.159 +typedef uint32_t                khronos_uint32_t;
   1.160 +typedef int64_t                 khronos_int64_t;
   1.161 +typedef uint64_t                khronos_uint64_t;
   1.162 +#define KHRONOS_SUPPORT_INT64   1
   1.163 +#define KHRONOS_SUPPORT_FLOAT   1
   1.164 +
   1.165 +#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
   1.166 +
   1.167 +/*
   1.168 + * Win32
   1.169 + */
   1.170 +typedef __int32                 khronos_int32_t;
   1.171 +typedef unsigned __int32        khronos_uint32_t;
   1.172 +typedef __int64                 khronos_int64_t;
   1.173 +typedef unsigned __int64        khronos_uint64_t;
   1.174 +#define KHRONOS_SUPPORT_INT64   1
   1.175 +#define KHRONOS_SUPPORT_FLOAT   1
   1.176 +
   1.177 +#elif defined(__sun__) || defined(__digital__)
   1.178 +
   1.179 +/*
   1.180 + * Sun or Digital
   1.181 + */
   1.182 +typedef int                     khronos_int32_t;
   1.183 +typedef unsigned int            khronos_uint32_t;
   1.184 +#if defined(__arch64__) || defined(_LP64)
   1.185 +typedef long int                khronos_int64_t;
   1.186 +typedef unsigned long int       khronos_uint64_t;
   1.187 +#else
   1.188 +typedef long long int           khronos_int64_t;
   1.189 +typedef unsigned long long int  khronos_uint64_t;
   1.190 +#endif /* __arch64__ */
   1.191 +#define KHRONOS_SUPPORT_INT64   1
   1.192 +#define KHRONOS_SUPPORT_FLOAT   1
   1.193 +
   1.194 +#elif 0
   1.195 +
   1.196 +/*
   1.197 + * Hypothetical platform with no float or int64 support
   1.198 + */
   1.199 +typedef int                     khronos_int32_t;
   1.200 +typedef unsigned int            khronos_uint32_t;
   1.201 +#define KHRONOS_SUPPORT_INT64   0
   1.202 +#define KHRONOS_SUPPORT_FLOAT   0
   1.203 +
   1.204 +#else
   1.205 +
   1.206 +/*
   1.207 + * Generic fallback
   1.208 + */
   1.209 +#include <stdint.h>
   1.210 +typedef int32_t                 khronos_int32_t;
   1.211 +typedef uint32_t                khronos_uint32_t;
   1.212 +typedef int64_t                 khronos_int64_t;
   1.213 +typedef uint64_t                khronos_uint64_t;
   1.214 +#define KHRONOS_SUPPORT_INT64   1
   1.215 +#define KHRONOS_SUPPORT_FLOAT   1
   1.216 +
   1.217 +#endif
   1.218 +
   1.219 +
   1.220 +/*
   1.221 + * Types that are (so far) the same on all platforms
   1.222 + */
   1.223 +typedef signed   char          khronos_int8_t;
   1.224 +typedef unsigned char          khronos_uint8_t;
   1.225 +typedef signed   short int     khronos_int16_t;
   1.226 +typedef unsigned short int     khronos_uint16_t;
   1.227 +typedef signed   long  int     khronos_intptr_t;
   1.228 +typedef unsigned long  int     khronos_uintptr_t;
   1.229 +typedef signed   long  int     khronos_ssize_t;
   1.230 +typedef unsigned long  int     khronos_usize_t;
   1.231 +
   1.232 +#if KHRONOS_SUPPORT_FLOAT
   1.233 +/*
   1.234 + * Float type
   1.235 + */
   1.236 +typedef          float         khronos_float_t;
   1.237 +#endif
   1.238 +
   1.239 +#if KHRONOS_SUPPORT_INT64
   1.240 +/* Time types
   1.241 + *
   1.242 + * These types can be used to represent a time interval in nanoseconds or
   1.243 + * an absolute Unadjusted System Time.  Unadjusted System Time is the number
   1.244 + * of nanoseconds since some arbitrary system event (e.g. since the last
   1.245 + * time the system booted).  The Unadjusted System Time is an unsigned
   1.246 + * 64 bit value that wraps back to 0 every 584 years.  Time intervals
   1.247 + * may be either signed or unsigned.
   1.248 + */
   1.249 +typedef khronos_uint64_t       khronos_utime_nanoseconds_t;
   1.250 +typedef khronos_int64_t        khronos_stime_nanoseconds_t;
   1.251 +#endif
   1.252 +
   1.253 +/*
   1.254 + * Dummy value used to pad enum types to 32 bits.
   1.255 + */
   1.256 +#ifndef KHRONOS_MAX_ENUM
   1.257 +#define KHRONOS_MAX_ENUM 0x7FFFFFFF
   1.258 +#endif
   1.259 +
   1.260 +/*
   1.261 + * Enumerated boolean type
   1.262 + *
   1.263 + * Values other than zero should be considered to be true.  Therefore
   1.264 + * comparisons should not be made against KHRONOS_TRUE.
   1.265 + */
   1.266 +typedef enum {
   1.267 +    KHRONOS_FALSE = 0,
   1.268 +    KHRONOS_TRUE  = 1,
   1.269 +    KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
   1.270 +} khronos_boolean_enum_t;
   1.271 +
   1.272 +#endif /* __khrplatform_h_ */

mercurial