13
0

Use g_mkstemp in audiographer for portability

This commit is contained in:
Paul Davis 2013-07-13 16:44:37 -04:00
parent 3be0f0aa0b
commit 48f8863b2c

View File

@ -4,6 +4,9 @@
#include <cstdio>
#include <string>
#include <glib.h>
#include <glib/gstdio.h>
#include "sndfile_writer.h"
#include "sndfile_reader.h"
@ -18,7 +21,7 @@ class TmpFile : public SndfileWriter<T>, public SndfileReader<T>
/// \a filename_template must match the requirements for mkstemp, i.e. end in "XXXXXX"
TmpFile (char * filename_template, int format, ChannelCount channels, framecnt_t samplerate)
: SndfileHandle (mkstemp(filename_template), true, SndfileBase::ReadWrite, format, channels, samplerate)
: SndfileHandle (g_mkstemp(filename_template), true, SndfileBase::ReadWrite, format, channels, samplerate)
, filename (filename_template)
{}