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 #endif
#ifndef SEXP_USE_IMAGE_LOADING #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 #endif
#ifndef SEXP_USE_UNSAFE_PUSH #ifndef SEXP_USE_UNSAFE_PUSH

6
main.c
View file

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