From cf4c68a0726616cff9f288b708ccb8e59baf002f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 26 Dec 2013 22:51:17 +0100 Subject: [PATCH] Make return type of read_file ssize_t again - include msvc_compat for Win32 boxes to get typedef for ssize_t --- file_path.c | 3 ++- file_path.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/file_path.c b/file_path.c index 2884b2e0a0..e14463eefa 100644 --- a/file_path.c +++ b/file_path.c @@ -39,6 +39,7 @@ #ifdef _MSC_VER #define setmode _setmode #endif +#include "msvc/msvc_compat.h" #ifdef _XBOX #include #define INVALID_FILE_ATTRIBUTES -1 @@ -70,7 +71,7 @@ bool write_file(const char *path, const void *data, size_t size) } // Generic file loader. -size_t read_file(const char *path, void **buf) +ssize_t read_file(const char *path, void **buf) { void *rom_buf = NULL; FILE *file = fopen(path, "rb"); diff --git a/file_path.h b/file_path.h index bb8c4623d7..4dd266cbe4 100644 --- a/file_path.h +++ b/file_path.h @@ -11,7 +11,7 @@ extern "C" { #endif -size_t read_file(const char *path, void **buf); +ssize_t read_file(const char *path, void **buf); bool read_file_string(const char *path, char **buf); bool write_file(const char *path, const void *buf, size_t size);