mirror of
https://github.com/wolfpld/tracy.git
synced 2026-09-07 11:02:51 +00:00
The old pre-flight truncated the output at startup with -f, so an interrupted capture lost the trace, and the probe fopen followed a symlink. The existing file is now moved to FILE~ for the duration of the capture and restored if the trace cannot be written.
24 lines
334 B
C++
24 lines
334 B
C++
#ifndef __CAPTUREFILEBACKUP_HPP__
|
|
#define __CAPTUREFILEBACKUP_HPP__
|
|
|
|
#include <stdint.h>
|
|
|
|
namespace tracy
|
|
{
|
|
|
|
enum class OutputPrep : uint8_t
|
|
{
|
|
Ok,
|
|
Exists,
|
|
Unusable
|
|
};
|
|
|
|
OutputPrep PrepareOutputFile( const char* path, bool overwrite, const char** error );
|
|
|
|
void RestoreOutputBackup();
|
|
void DiscardOutputBackup();
|
|
|
|
}
|
|
|
|
#endif
|