Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 1 | // Copyright 2016 The SwiftShader Authors. All Rights Reserved. |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2 | // |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 3 | // 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 Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 6 | // |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 8 | // |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 9 | // 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 Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 14 | |
| 15 | #include "Debug.hpp" |
| 16 | |
| 17 | #include <stdio.h> |
| 18 | #include <stdarg.h> |
| 19 | |
Nicolas Capens | a5dfd97d | 2018-09-28 15:27:08 -0400 | [diff] [blame] | 20 | namespace sw |
| 21 | { |
Greg Hartman | d61ac5f | 2015-04-09 18:48:53 -0700 | [diff] [blame] | 22 | void trace(const char *format, ...) |
| 23 | { |
| 24 | if(false) |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 25 | { |
Greg Hartman | d61ac5f | 2015-04-09 18:48:53 -0700 | [diff] [blame] | 26 | FILE *file = fopen("debug.txt", "a"); |
| 27 | |
| 28 | if(file) |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 29 | { |
Greg Hartman | d61ac5f | 2015-04-09 18:48:53 -0700 | [diff] [blame] | 30 | va_list vararg; |
| 31 | va_start(vararg, format); |
| 32 | vfprintf(file, format, vararg); |
| 33 | va_end(vararg); |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 34 | |
Greg Hartman | d61ac5f | 2015-04-09 18:48:53 -0700 | [diff] [blame] | 35 | fclose(file); |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 36 | } |
| 37 | } |
Greg Hartman | d61ac5f | 2015-04-09 18:48:53 -0700 | [diff] [blame] | 38 | } |
Nicolas Capens | a5dfd97d | 2018-09-28 15:27:08 -0400 | [diff] [blame] | 39 | } |