Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: src/sksl/SkSLUtil.h

Issue 1984363002: initial checkin of SkSL compiler (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: documentation and cleanups Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SKSL_UTIL
9 #define SKSL_UTIL
10
11 #include <string>
12 #include <sstream>
13 #include "stdlib.h"
14 #include "SkTypes.h"
15
16 namespace SkSL {
17
18 // our own definitions of certain std:: functions, because they are not always p resent on Android
19
20 template <typename T> std::string to_string(T value) {
21 #ifdef SK_BUILD_FOR_ANDROID
22 std::stringstream buffer;
23 buffer << value;
24 return buffer.str();
25 #else
26 return to_string(value);
27 #endif
28 }
29
30 int stoi(std::string s);
31
32 double stod(std::string s);
33
34 long stol(std::string s);
35
36 void sksl_abort() __attribute__((__noreturn__));
37
38 } // namespace
39
40 #ifdef DEBUG
41 #define ASSERT(x) assert(x)
42 #define ASSERT_RESULT(x) { bool result = x; ASSERT(x); }
43 #else
44 #define ASSERT(x)
45 #define ASSERT_RESULT(x) x
46 #endif
47
48 #define ABORT(...) { SkDebugf(__VA_ARGS__); sksl_abort(); }
49
50 #endif
OLDNEW
« src/gpu/vk/GrVkGpu.h ('K') | « src/sksl/SkSLToken.h ('k') | src/sksl/SkSLUtil.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698