blob: 49d37e3056973ba3c1a7ec017c27438836855421 [file] [log] [blame]
ethannicholasb3058bd2016-07-01 08:22:01 -07001/*
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#include "SkSLUtil.h"
9
Ethan Nicholas9e1138d2016-11-21 10:39:35 -050010#ifndef __STDC_FORMAT_MACROS
11#define __STDC_FORMAT_MACROS
12#endif
Ethan Nicholas9e1138d2016-11-21 10:39:35 -050013
ethannicholasb3058bd2016-07-01 08:22:01 -070014namespace SkSL {
15
Ethan Nicholas0df1b042017-03-31 13:56:23 -040016#ifdef SKSL_STANDALONE
17StandaloneShaderCaps standaloneCaps;
Ethan Nicholas9e1138d2016-11-21 10:39:35 -050018#endif
ethannicholasb3058bd2016-07-01 08:22:01 -070019
20void sksl_abort() {
Ethan Nicholas0df1b042017-03-31 13:56:23 -040021#ifdef SKSL_STANDALONE
22 abort();
23#else
ethannicholasb3058bd2016-07-01 08:22:01 -070024 sk_abort_no_print();
25 exit(1);
ethannicholasb3058bd2016-07-01 08:22:01 -070026#endif
27}
28
Ethan Nicholas0df1b042017-03-31 13:56:23 -040029void write_stringstream(const StringStream& s, OutputStream& out) {
Ethan Nicholas762466e2017-06-29 10:03:38 -040030 out.write(s.str().c_str(), s.str().size());
Ethan Nicholas9e1138d2016-11-21 10:39:35 -050031}
32
ethannicholasb3058bd2016-07-01 08:22:01 -070033} // namespace