webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
angle_config.h
Go to the documentation of this file.
1 //
2 // Copyright 2015 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // angle_config.h:
7 // Helpers for importing the gpu test expectations package from Chrome.
8 //
9 
10 #ifndef GPU_TEST_EXPECTATIONS_ANGLE_CONFIG_H_
11 #define GPU_TEST_EXPECTATIONS_ANGLE_CONFIG_H_
12 
13 #include <stdint.h>
14 
15 #include <iostream>
16 
17 #include "common/debug.h"
18 #include "common/string_utils.h"
19 
20 #define DCHECK_EQ(A,B) ASSERT((A) == (B))
21 #define DCHECK_NE(A,B) ASSERT((A) != (B))
22 #define DCHECK(X) ASSERT(X)
23 #define LOG(X) std::cerr
24 
25 #define GPU_EXPORT
26 
27 typedef int32_t int32;
28 typedef uint32_t uint32;
29 typedef int64_t int64;
30 typedef uint64_t uint64;
31 
32 // Shim Chromium's base by importing functions in the base namespace.
33 namespace base
34 {
40  using angle::SplitString;
44 
45  // StringPrintf is called differently in ANGLE but using cannot change
46  // the name of the imported function. Use a define to change the name.
48  #define StringPrintf FormatString
49 }
50 
51 // TODO(jmadill): other platforms
52 // clang-format off
53 #if defined(_WIN32) || defined(_WIN64)
54 # define OS_WIN
55 #elif defined(ANDROID)
56 # define OS_ANDROID
57 #elif defined(__linux__)
58 # define OS_LINUX
59 #elif defined(__APPLE__)
60 # define OS_MACOSX
61 #else
62 # error "Unsupported platform"
63 #endif
64 // clang-format on
65 
66 #endif
unsigned long long uint64_t
Definition: ptypes.h:120
signed int int32_t
Definition: ptypes.h:101
bool ReadFileToString(const std::string &path, std::string *stringOut)
Definition: string_utils.cpp:125
unsigned int uint32_t
Definition: ptypes.h:105
Definition: string_utils.h:26
signed long long int64_t
Definition: ptypes.h:112
std::string FormatString(const char *fmt, va_list vararg)
Definition: angleutils.cpp:37
uint64_t uint64
Definition: angle_config.h:30
int64_t int64
Definition: angle_config.h:29
Definition: string_utils.h:25
Definition: string_utils.h:32
Definition: safe_conversions.h:16
const char kWhitespaceASCII[]
Definition: string_utils.cpp:23
bool HexStringToUInt(const std::string &input, unsigned int *uintOut)
Definition: string_utils.cpp:105
std::vector< std::string > SplitString(const std::string &input, const std::string &delimiters, WhitespaceHandling whitespace, SplitResult resultType)
Definition: string_utils.cpp:25
uint32_t uint32
Definition: angle_config.h:28
void SplitStringAlongWhitespace(const std::string &input, std::vector< std::string > *tokensOut)
Definition: string_utils.cpp:67
Definition: string_utils.h:31
int32_t int32
Definition: angle_config.h:27