mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-17 15:59:57 +00:00
Set O_BINARY in Win32 on stdin reads.
This commit is contained in:
parent
cadd7b9728
commit
2459793f9c
9
file.c
9
file.c
@ -23,12 +23,21 @@
|
||||
#include <string.h>
|
||||
#include "dynamic.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
// Load SNES rom only. Applies a hack for headered ROMs.
|
||||
static ssize_t read_rom_file(FILE* file, void** buf)
|
||||
{
|
||||
ssize_t ret;
|
||||
if (file == NULL) // stdin
|
||||
{
|
||||
#ifdef _WIN32
|
||||
setmode(0, O_BINARY);
|
||||
#endif
|
||||
|
||||
SSNES_LOG("Reading ROM from stdin ...\n");
|
||||
size_t buf_size = 0xFFFFF; // Some initial guesstimate.
|
||||
size_t buf_ptr = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user