From: notaz Date: Sun, 6 Jan 2013 18:36:08 +0000 (+0200) Subject: frontend: get rid of _FILE_OFFSET_BITS X-Git-Tag: r18~2 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=commitdiff_plain;h=a3da90a9a8630604a08c5d17b94a07c097e2ec29 frontend: get rid of _FILE_OFFSET_BITS pandora's zlib is too old to handle off_t with that define --- diff --git a/Makefile b/Makefile index 0ef73646..0d72dea0 100644 --- a/Makefile +++ b/Makefile @@ -154,7 +154,6 @@ OBJS += frontend/libpicofe/linux/fbdev.o frontend/libpicofe/linux/xenv.o OBJS += frontend/libpicofe/linux/in_evdev.o OBJS += frontend/plat_pandora.o frontend/plat_omap.o frontend/main.o frontend/menu.o: CFLAGS += -include frontend/pandora/ui_feat.h -frontend/menu.o: CFLAGS += -D_FILE_OFFSET_BITS=64 USE_PLUGIN_LIB = 1 USE_FRONTEND = 1 endif diff --git a/frontend/menu.c b/frontend/menu.c index eb004d8f..e1402dee 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -211,7 +211,7 @@ static int optional_cdimg_filter(struct dirent **namelist, int count, const char *ext, *p; char buf[256], buf2[256]; int i, d, ret, good_cue; - struct stat statf; + struct stat64 statf; FILE *f; for (i = 1; i < count; i++) { @@ -255,7 +255,7 @@ static int optional_cdimg_filter(struct dirent **namelist, int count, p = buf2; snprintf(buf, sizeof(buf), "%s/%s", basedir, p); - ret = stat(buf, &statf); + ret = stat64(buf, &statf); if (ret == 0) { rm_namelist_entry(namelist, count, p); good_cue = 1; @@ -510,7 +510,7 @@ static int menu_do_last_cd_img(int is_get) { static const char *defaults[] = { "/media", "/mnt/sd", "/mnt" }; char path[256]; - struct stat st; + struct stat64 st; FILE *f; int i, ret = -1; @@ -533,7 +533,7 @@ static int menu_do_last_cd_img(int is_get) out: if (is_get) { for (i = 0; last_selected_fname[0] == 0 - || stat(last_selected_fname, &st) != 0; i++) + || stat64(last_selected_fname, &st) != 0; i++) { if (i >= ARRAY_SIZE(defaults)) break; @@ -721,8 +721,8 @@ static void draw_savestate_bg(int slot) if (f == NULL) return; - if (gzseek(f, 0x29933d, SEEK_SET) != 0x29933d) { - fprintf(stderr, "gzseek failed\n"); + if ((ret = (int)gzseek(f, 0x29933d, SEEK_SET)) != 0x29933d) { + fprintf(stderr, "gzseek failed: %d\n", ret); gzclose(f); return; }