add ps_fopen to properly handle fopen on Windows

fixes #22
This commit is contained in:
tildearrow 2022-01-20 05:04:03 -05:00
parent 06dfb7e803
commit 8ab97a959c
8 changed files with 35 additions and 10 deletions

View file

@ -1,6 +1,7 @@
#include "engine.h"
#include "instrument.h"
#include "../ta-log.h"
#include "../fileutils.h"
void DivInstrument::putInsData(SafeWriter* w) {
w->write("INST",4);
@ -159,7 +160,7 @@ bool DivInstrument::save(const char* path) {
putInsData(w);
FILE* outFile=fopen(path,"wb");
FILE* outFile=ps_fopen(path,"wb");
if (outFile==NULL) {
logE("could not save instrument: %s!\n",strerror(errno));
w->finish();
@ -171,4 +172,4 @@ bool DivInstrument::save(const char* path) {
fclose(outFile);
w->finish();
return true;
}
}