gfx/angle/include/KHR/khrplatform.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 #ifndef __khrplatform_h_
michael@0 2 #define __khrplatform_h_
michael@0 3
michael@0 4 /*
michael@0 5 ** Copyright (c) 2008-2009 The Khronos Group Inc.
michael@0 6 **
michael@0 7 ** Permission is hereby granted, free of charge, to any person obtaining a
michael@0 8 ** copy of this software and/or associated documentation files (the
michael@0 9 ** "Materials"), to deal in the Materials without restriction, including
michael@0 10 ** without limitation the rights to use, copy, modify, merge, publish,
michael@0 11 ** distribute, sublicense, and/or sell copies of the Materials, and to
michael@0 12 ** permit persons to whom the Materials are furnished to do so, subject to
michael@0 13 ** the following conditions:
michael@0 14 **
michael@0 15 ** The above copyright notice and this permission notice shall be included
michael@0 16 ** in all copies or substantial portions of the Materials.
michael@0 17 **
michael@0 18 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
michael@0 19 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
michael@0 20 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
michael@0 21 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
michael@0 22 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
michael@0 23 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
michael@0 24 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
michael@0 25 */
michael@0 26
michael@0 27 /* Khronos platform-specific types and definitions.
michael@0 28 *
michael@0 29 * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
michael@0 30 *
michael@0 31 * Adopters may modify this file to suit their platform. Adopters are
michael@0 32 * encouraged to submit platform specific modifications to the Khronos
michael@0 33 * group so that they can be included in future versions of this file.
michael@0 34 * Please submit changes by sending them to the public Khronos Bugzilla
michael@0 35 * (http://khronos.org/bugzilla) by filing a bug against product
michael@0 36 * "Khronos (general)" component "Registry".
michael@0 37 *
michael@0 38 * A predefined template which fills in some of the bug fields can be
michael@0 39 * reached using http://tinyurl.com/khrplatform-h-bugreport, but you
michael@0 40 * must create a Bugzilla login first.
michael@0 41 *
michael@0 42 *
michael@0 43 * See the Implementer's Guidelines for information about where this file
michael@0 44 * should be located on your system and for more details of its use:
michael@0 45 * http://www.khronos.org/registry/implementers_guide.pdf
michael@0 46 *
michael@0 47 * This file should be included as
michael@0 48 * #include <KHR/khrplatform.h>
michael@0 49 * by Khronos client API header files that use its types and defines.
michael@0 50 *
michael@0 51 * The types in khrplatform.h should only be used to define API-specific types.
michael@0 52 *
michael@0 53 * Types defined in khrplatform.h:
michael@0 54 * khronos_int8_t signed 8 bit
michael@0 55 * khronos_uint8_t unsigned 8 bit
michael@0 56 * khronos_int16_t signed 16 bit
michael@0 57 * khronos_uint16_t unsigned 16 bit
michael@0 58 * khronos_int32_t signed 32 bit
michael@0 59 * khronos_uint32_t unsigned 32 bit
michael@0 60 * khronos_int64_t signed 64 bit
michael@0 61 * khronos_uint64_t unsigned 64 bit
michael@0 62 * khronos_intptr_t signed same number of bits as a pointer
michael@0 63 * khronos_uintptr_t unsigned same number of bits as a pointer
michael@0 64 * khronos_ssize_t signed size
michael@0 65 * khronos_usize_t unsigned size
michael@0 66 * khronos_float_t signed 32 bit floating point
michael@0 67 * khronos_time_ns_t unsigned 64 bit time in nanoseconds
michael@0 68 * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
michael@0 69 * nanoseconds
michael@0 70 * khronos_stime_nanoseconds_t signed time interval in nanoseconds
michael@0 71 * khronos_boolean_enum_t enumerated boolean type. This should
michael@0 72 * only be used as a base type when a client API's boolean type is
michael@0 73 * an enum. Client APIs which use an integer or other type for
michael@0 74 * booleans cannot use this as the base type for their boolean.
michael@0 75 *
michael@0 76 * Tokens defined in khrplatform.h:
michael@0 77 *
michael@0 78 * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
michael@0 79 *
michael@0 80 * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
michael@0 81 * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
michael@0 82 *
michael@0 83 * Calling convention macros defined in this file:
michael@0 84 * KHRONOS_APICALL
michael@0 85 * KHRONOS_APIENTRY
michael@0 86 * KHRONOS_APIATTRIBUTES
michael@0 87 *
michael@0 88 * These may be used in function prototypes as:
michael@0 89 *
michael@0 90 * KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
michael@0 91 * int arg1,
michael@0 92 * int arg2) KHRONOS_APIATTRIBUTES;
michael@0 93 */
michael@0 94
michael@0 95 /*-------------------------------------------------------------------------
michael@0 96 * Definition of KHRONOS_APICALL
michael@0 97 *-------------------------------------------------------------------------
michael@0 98 * This precedes the return type of the function in the function prototype.
michael@0 99 */
michael@0 100 #if defined(_WIN32) && !defined(__SCITECH_SNAP__)
michael@0 101 # define KHRONOS_APICALL __declspec(dllimport)
michael@0 102 #elif defined (__SYMBIAN32__)
michael@0 103 # define KHRONOS_APICALL IMPORT_C
michael@0 104 #else
michael@0 105 # define KHRONOS_APICALL
michael@0 106 #endif
michael@0 107
michael@0 108 /*-------------------------------------------------------------------------
michael@0 109 * Definition of KHRONOS_APIENTRY
michael@0 110 *-------------------------------------------------------------------------
michael@0 111 * This follows the return type of the function and precedes the function
michael@0 112 * name in the function prototype.
michael@0 113 */
michael@0 114 #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
michael@0 115 /* Win32 but not WinCE */
michael@0 116 # define KHRONOS_APIENTRY __stdcall
michael@0 117 #else
michael@0 118 # define KHRONOS_APIENTRY
michael@0 119 #endif
michael@0 120
michael@0 121 /*-------------------------------------------------------------------------
michael@0 122 * Definition of KHRONOS_APIATTRIBUTES
michael@0 123 *-------------------------------------------------------------------------
michael@0 124 * This follows the closing parenthesis of the function prototype arguments.
michael@0 125 */
michael@0 126 #if defined (__ARMCC_2__)
michael@0 127 #define KHRONOS_APIATTRIBUTES __softfp
michael@0 128 #else
michael@0 129 #define KHRONOS_APIATTRIBUTES
michael@0 130 #endif
michael@0 131
michael@0 132 /*-------------------------------------------------------------------------
michael@0 133 * basic type definitions
michael@0 134 *-----------------------------------------------------------------------*/
michael@0 135 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
michael@0 136
michael@0 137
michael@0 138 /*
michael@0 139 * Using <stdint.h>
michael@0 140 */
michael@0 141 #include <stdint.h>
michael@0 142 typedef int32_t khronos_int32_t;
michael@0 143 typedef uint32_t khronos_uint32_t;
michael@0 144 typedef int64_t khronos_int64_t;
michael@0 145 typedef uint64_t khronos_uint64_t;
michael@0 146 #define KHRONOS_SUPPORT_INT64 1
michael@0 147 #define KHRONOS_SUPPORT_FLOAT 1
michael@0 148
michael@0 149 #elif defined(__VMS ) || defined(__sgi)
michael@0 150
michael@0 151 /*
michael@0 152 * Using <inttypes.h>
michael@0 153 */
michael@0 154 #include <inttypes.h>
michael@0 155 typedef int32_t khronos_int32_t;
michael@0 156 typedef uint32_t khronos_uint32_t;
michael@0 157 typedef int64_t khronos_int64_t;
michael@0 158 typedef uint64_t khronos_uint64_t;
michael@0 159 #define KHRONOS_SUPPORT_INT64 1
michael@0 160 #define KHRONOS_SUPPORT_FLOAT 1
michael@0 161
michael@0 162 #elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
michael@0 163
michael@0 164 /*
michael@0 165 * Win32
michael@0 166 */
michael@0 167 typedef __int32 khronos_int32_t;
michael@0 168 typedef unsigned __int32 khronos_uint32_t;
michael@0 169 typedef __int64 khronos_int64_t;
michael@0 170 typedef unsigned __int64 khronos_uint64_t;
michael@0 171 #define KHRONOS_SUPPORT_INT64 1
michael@0 172 #define KHRONOS_SUPPORT_FLOAT 1
michael@0 173
michael@0 174 #elif defined(__sun__) || defined(__digital__)
michael@0 175
michael@0 176 /*
michael@0 177 * Sun or Digital
michael@0 178 */
michael@0 179 typedef int khronos_int32_t;
michael@0 180 typedef unsigned int khronos_uint32_t;
michael@0 181 #if defined(__arch64__) || defined(_LP64)
michael@0 182 typedef long int khronos_int64_t;
michael@0 183 typedef unsigned long int khronos_uint64_t;
michael@0 184 #else
michael@0 185 typedef long long int khronos_int64_t;
michael@0 186 typedef unsigned long long int khronos_uint64_t;
michael@0 187 #endif /* __arch64__ */
michael@0 188 #define KHRONOS_SUPPORT_INT64 1
michael@0 189 #define KHRONOS_SUPPORT_FLOAT 1
michael@0 190
michael@0 191 #elif 0
michael@0 192
michael@0 193 /*
michael@0 194 * Hypothetical platform with no float or int64 support
michael@0 195 */
michael@0 196 typedef int khronos_int32_t;
michael@0 197 typedef unsigned int khronos_uint32_t;
michael@0 198 #define KHRONOS_SUPPORT_INT64 0
michael@0 199 #define KHRONOS_SUPPORT_FLOAT 0
michael@0 200
michael@0 201 #else
michael@0 202
michael@0 203 /*
michael@0 204 * Generic fallback
michael@0 205 */
michael@0 206 #include <stdint.h>
michael@0 207 typedef int32_t khronos_int32_t;
michael@0 208 typedef uint32_t khronos_uint32_t;
michael@0 209 typedef int64_t khronos_int64_t;
michael@0 210 typedef uint64_t khronos_uint64_t;
michael@0 211 #define KHRONOS_SUPPORT_INT64 1
michael@0 212 #define KHRONOS_SUPPORT_FLOAT 1
michael@0 213
michael@0 214 #endif
michael@0 215
michael@0 216
michael@0 217 /*
michael@0 218 * Types that are (so far) the same on all platforms
michael@0 219 */
michael@0 220 typedef signed char khronos_int8_t;
michael@0 221 typedef unsigned char khronos_uint8_t;
michael@0 222 typedef signed short int khronos_int16_t;
michael@0 223 typedef unsigned short int khronos_uint16_t;
michael@0 224 typedef signed long int khronos_intptr_t;
michael@0 225 typedef unsigned long int khronos_uintptr_t;
michael@0 226 typedef signed long int khronos_ssize_t;
michael@0 227 typedef unsigned long int khronos_usize_t;
michael@0 228
michael@0 229 #if KHRONOS_SUPPORT_FLOAT
michael@0 230 /*
michael@0 231 * Float type
michael@0 232 */
michael@0 233 typedef float khronos_float_t;
michael@0 234 #endif
michael@0 235
michael@0 236 #if KHRONOS_SUPPORT_INT64
michael@0 237 /* Time types
michael@0 238 *
michael@0 239 * These types can be used to represent a time interval in nanoseconds or
michael@0 240 * an absolute Unadjusted System Time. Unadjusted System Time is the number
michael@0 241 * of nanoseconds since some arbitrary system event (e.g. since the last
michael@0 242 * time the system booted). The Unadjusted System Time is an unsigned
michael@0 243 * 64 bit value that wraps back to 0 every 584 years. Time intervals
michael@0 244 * may be either signed or unsigned.
michael@0 245 */
michael@0 246 typedef khronos_uint64_t khronos_utime_nanoseconds_t;
michael@0 247 typedef khronos_int64_t khronos_stime_nanoseconds_t;
michael@0 248 #endif
michael@0 249
michael@0 250 /*
michael@0 251 * Dummy value used to pad enum types to 32 bits.
michael@0 252 */
michael@0 253 #ifndef KHRONOS_MAX_ENUM
michael@0 254 #define KHRONOS_MAX_ENUM 0x7FFFFFFF
michael@0 255 #endif
michael@0 256
michael@0 257 /*
michael@0 258 * Enumerated boolean type
michael@0 259 *
michael@0 260 * Values other than zero should be considered to be true. Therefore
michael@0 261 * comparisons should not be made against KHRONOS_TRUE.
michael@0 262 */
michael@0 263 typedef enum {
michael@0 264 KHRONOS_FALSE = 0,
michael@0 265 KHRONOS_TRUE = 1,
michael@0 266 KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
michael@0 267 } khronos_boolean_enum_t;
michael@0 268
michael@0 269 #endif /* __khrplatform_h_ */

mercurial