Conditionally defining PRIoff for off_t printf.

Fixes issue #320.
This commit is contained in:
Alex Shinn 2016-04-09 20:09:57 +09:00
parent d8a29fed49
commit 78e8a04dd6
2 changed files with 7 additions and 1 deletions

View file

@ -608,7 +608,7 @@ sexp sexp_load_image (const char* filename, off_t offset, sexp_uint_t heap_free_
goto done; goto done;
} }
if (offset > 0 && fseek(fp, offset, SEEK_SET) < 0) { if (offset > 0 && fseek(fp, offset, SEEK_SET) < 0) {
snprintf(gc_heap_err_str, ERR_STR_SIZE, "couldn't seek to image offset: %s -> %lld: %s\n", filename, offset, strerror(errno)); snprintf(gc_heap_err_str, ERR_STR_SIZE, "couldn't seek to image offset: %s -> "PRIoff": %s\n", filename, offset, strerror(errno));
goto done; goto done;
} }

View file

@ -256,6 +256,12 @@ typedef short sexp_int32_t;
# endif # endif
#endif #endif
#ifdef __APPLE__
#define PRIoff "%lld"
#else
#define PRIoff "%ld"
#endif
#if SEXP_USE_LONG_PROCEDURE_ARGS #if SEXP_USE_LONG_PROCEDURE_ARGS
typedef int sexp_proc_num_args_t; typedef int sexp_proc_num_args_t;
#else #else