[前][次][番号順一覧][スレッド一覧]

ruby-changes:70816

From: Kazuhiro <ko1@a...>
Date: Tue, 11 Jan 2022 17:33:36 +0900 (JST)
Subject: [ruby-changes:70816] b5310b8975 (master): Fix compile errors

https://git.ruby-lang.org/ruby.git/commit/?id=b5310b8975

From b5310b8975dffd18a90e149e00673b585101cab8 Mon Sep 17 00:00:00 2001
From: Kazuhiro NISHIYAMA <zn@m...>
Date: Tue, 11 Jan 2022 17:33:01 +0900
Subject: Fix compile errors

```
compiling ../ruby.c
../ruby.c:1547:17: error: implicit declaration of function 'setup_yjit_options' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                setup_yjit_options(s, &opt->yjit);
                ^
../ruby.c:1547:17: note: did you mean 'setup_mjit_options'?
../ruby.c:1122:1: note: 'setup_mjit_options' declared here
setup_mjit_options(const char *s, struct mjit_options *mjit_opt)
^
../ruby.c:1547:45: error: no member named 'yjit' in 'struct ruby_cmdline_options'; did you mean 'mjit'?
                setup_yjit_options(s, &opt->yjit);
                                            ^~~~
                                            mjit
../ruby.c:192:25: note: 'mjit' declared here
    struct mjit_options mjit;
                        ^
../ruby.c:1924:28: error: no member named 'yjit' in 'struct ruby_cmdline_options'; did you mean 'mjit'?
        rb_yjit_init(&opt->yjit);
                           ^~~~
                           mjit
../ruby.c:192:25: note: 'mjit' declared here
    struct mjit_options mjit;
                        ^
3 errors generated.
```
---
 ruby.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ruby.c b/ruby.c
index c06cd7bd787..92448d84816 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1542,7 +1542,7 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt) https://github.com/ruby/ruby/blob/trunk/ruby.c#L1542
 #endif
             }
             else if (is_option_with_optarg("yjit", '-', true, false, false)) {
-#if USE_MJIT
+#if YJIT_SUPPORTED_P
                 FEATURE_SET(opt->features, FEATURE_BIT(yjit));
                 setup_yjit_options(s, &opt->yjit);
 #else
@@ -1921,7 +1921,9 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt) https://github.com/ruby/ruby/blob/trunk/ruby.c#L1921
             exit(1);
         }
 #endif
+#if YJIT_SUPPORTED_P
         rb_yjit_init(&opt->yjit);
+#endif
     }
     if (opt->dump & (DUMP_BIT(version) | DUMP_BIT(version_v))) {
 #if USE_MJIT
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]