From 78e7875fe934782f35e42010ac7fb2e7f89bcb7c Mon Sep 17 00:00:00 2001 From: Conrad Kostecki Date: Sat, 22 Jun 2024 03:19:00 +0200 Subject: [PATCH] Switch from off64_t to off_t (#247) --- CMakeLists.txt | 4 ++++ src/wx-ui/wx-config.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf18a76a..c42c6415 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,10 @@ endif() set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fomit-frame-pointer -mstackrealign -fno-strict-aliasing") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer -mstackrealign -fno-strict-aliasing") +if (UNIX) + add_definitions(-D_FILE_OFFSET_BITS=64) +endif () + set(PCEM_VERSION_STRING "vNext" CACHE STRING "PCem Version String") set(PCEM_DISPLAY_ENGINE "wxWidgets" CACHE STRING "PCem Display Engine") set(PCEM_DEFINES ${PCEM_DEFINES} PCEM_VERSION_STRING="${PCEM_VERSION_STRING}") diff --git a/src/wx-ui/wx-config.c b/src/wx-ui/wx-config.c index 74e0e411..3ea28339 100644 --- a/src/wx-ui/wx-config.c +++ b/src/wx-ui/wx-config.c @@ -1337,7 +1337,7 @@ static device_t *hdd_controller_selected_get_device(void *hdlg) { return NULL; } -static void check_hd_type(void *hdlg, off64_t sz) { +static void check_hd_type(void *hdlg, off_t sz) { int c; hd_new_type = 0; @@ -2037,7 +2037,7 @@ static int hd_new(void *hdlg, int drive) { static int hd_file(void *hdlg, int drive) { if (!getfile(hdlg, "Hard disc image (*.img;*.vhd)|*.img;*.vhd|All files (*.*)|*.*", "")) { - off64_t sz; + off_t sz; FILE *f = fopen64(openfilestring, "rb"); if (!f) { wx_messagebox(hdlg, "Can't open file for read", "PCem error", WX_MB_OK);