blob: acf469e5ab58ac5f8701160d4a6e55d72225522a [file] [log] [blame]
Nicolas Capens0bac2852016-05-07 06:09:58 -04001// Copyright 2016 The SwiftShader Authors. All Rights Reserved.
John Bauman89401822014-05-06 15:04:28 -04002//
Nicolas Capens0bac2852016-05-07 06:09:58 -04003// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
John Bauman89401822014-05-06 15:04:28 -04006//
Nicolas Capens0bac2852016-05-07 06:09:58 -04007// http://www.apache.org/licenses/LICENSE-2.0
John Bauman89401822014-05-06 15:04:28 -04008//
Nicolas Capens0bac2852016-05-07 06:09:58 -04009// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
John Bauman89401822014-05-06 15:04:28 -040014
15#include "Debug.hpp"
16
17#include <stdio.h>
18#include <stdarg.h>
19
Nicolas Capensa5dfd97d2018-09-28 15:27:08 -040020namespace sw
21{
Greg Hartmand61ac5f2015-04-09 18:48:53 -070022void trace(const char *format, ...)
23{
24 if(false)
John Bauman89401822014-05-06 15:04:28 -040025 {
Greg Hartmand61ac5f2015-04-09 18:48:53 -070026 FILE *file = fopen("debug.txt", "a");
27
28 if(file)
John Bauman89401822014-05-06 15:04:28 -040029 {
Greg Hartmand61ac5f2015-04-09 18:48:53 -070030 va_list vararg;
31 va_start(vararg, format);
32 vfprintf(file, format, vararg);
33 va_end(vararg);
John Bauman89401822014-05-06 15:04:28 -040034
Greg Hartmand61ac5f2015-04-09 18:48:53 -070035 fclose(file);
John Bauman89401822014-05-06 15:04:28 -040036 }
37 }
Greg Hartmand61ac5f2015-04-09 18:48:53 -070038}
Nicolas Capensa5dfd97d2018-09-28 15:27:08 -040039}