image options are harmless in non-image build; images not supported on 32-bit arch

This commit is contained in:
Alex Shinn 2020-07-31 15:32:59 +09:00
parent 306cc73bd6
commit 4335d238fb
2 changed files with 5 additions and 3 deletions

View file

@ -835,7 +835,7 @@
#endif
#ifndef SEXP_USE_IMAGE_LOADING
#define SEXP_USE_IMAGE_LOADING SEXP_USE_DL && !SEXP_USE_GLOBAL_HEAP && !SEXP_USE_BOEHM && !SEXP_USE_NO_FEATURES
#define SEXP_USE_IMAGE_LOADING SEXP_USE_DL && SEXP_64_BIT && !SEXP_USE_GLOBAL_HEAP && !SEXP_USE_BOEHM && !SEXP_USE_NO_FEATURES
#endif
#ifndef SEXP_USE_UNSAFE_PUSH

6
main.c
View file

@ -439,9 +439,9 @@ sexp run_main (int argc, char **argv) {
}
#endif
break;
#if SEXP_USE_IMAGE_LOADING
case 'i':
arg = ((argv[i][2] == '\0') ? argv[++i] : argv[i]+2);
#if SEXP_USE_IMAGE_LOADING
if (ctx) {
fprintf(stderr, "-i <file>: image files must be loaded before other command-line options are specified: %s\n", arg);
if (sexp_truep(sexp_global(ctx, SEXP_G_STRICT_P)))
@ -457,6 +457,7 @@ sexp run_main (int argc, char **argv) {
env = sexp_load_standard_params(ctx, sexp_context_env(ctx), nonblocking);
init_loaded++;
}
#endif
break;
case 'd':
if (! init_loaded++) {
@ -464,14 +465,15 @@ sexp run_main (int argc, char **argv) {
env = sexp_load_standard_env(ctx, env, SEXP_SEVEN);
}
arg = ((argv[i][2] == '\0') ? argv[++i] : argv[i]+2);
#if SEXP_USE_IMAGE_LOADING
if (sexp_save_image(ctx, arg) != SEXP_TRUE) {
fprintf(stderr, "-d <file>: couldn't save image to file: %s\n", arg);
fprintf(stderr, " %s\n", sexp_load_image_err());
exit_failure();
}
#endif
quit = 1;
break;
#endif
case 'V':
load_init(1);
if (! sexp_oportp(out))