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 #include "SkSLUtil.h" 9 10 #ifndef __STDC_FORMAT_MACROS 11 #define __STDC_FORMAT_MACROS 12 #endif 13 14 namespace SkSL { 15 16 #ifdef SKSL_STANDALONE 17 StandaloneShaderCaps standaloneCaps; 18 #endif 19 sksl_abort()20void sksl_abort() { 21 #ifdef SKSL_STANDALONE 22 abort(); 23 #else 24 sk_abort_no_print(); 25 exit(1); 26 #endif 27 } 28 write_stringstream(const StringStream & s,OutputStream & out)29void write_stringstream(const StringStream& s, OutputStream& out) { 30 out.write(s.str().c_str(), s.str().size()); 31 } 32 33 } // namespace 34