mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 07:20:36 +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 <string.h>
|
||||||
#include "dynamic.h"
|
#include "dynamic.h"
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <io.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// Load SNES rom only. Applies a hack for headered ROMs.
|
// Load SNES rom only. Applies a hack for headered ROMs.
|
||||||
static ssize_t read_rom_file(FILE* file, void** buf)
|
static ssize_t read_rom_file(FILE* file, void** buf)
|
||||||
{
|
{
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
if (file == NULL) // stdin
|
if (file == NULL) // stdin
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
setmode(0, O_BINARY);
|
||||||
|
#endif
|
||||||
|
|
||||||
SSNES_LOG("Reading ROM from stdin ...\n");
|
SSNES_LOG("Reading ROM from stdin ...\n");
|
||||||
size_t buf_size = 0xFFFFF; // Some initial guesstimate.
|
size_t buf_size = 0xFFFFF; // Some initial guesstimate.
|
||||||
size_t buf_ptr = 0;
|
size_t buf_ptr = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user