mmtk / ruby

Fork of The Ruby Programming Language [mirror], with added support for MMTk
https://www.ruby-lang.org/
Other
0 stars 1 forks source link

Fix undeclared function `rb_mmtk_enabled_p` when compiling #63

Closed eileencodes closed 6 months ago

eileencodes commented 6 months ago

I noticed that in CI and locally the mmtk branch wasn't compiling and failing on the following compilation errors:

gc.c:10074:9: error: call to undeclared function 'rb_mmtk_enabled_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    if (rb_mmtk_enabled_p()) {
        ^
error.c:1076:39: error: call to undeclared function 'rb_mmtk_enabled_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    if (rb_current_execution_context(!rb_mmtk_enabled_p())) {
                                      ^

The internal/mmtk_support.h header is included fine, but these two lines were using ifdef USE_MMTK rather than if USE_MMTK. Changing these allows CRuby mmtk branch to get past these compilation errors.

See https://github.com/mmtk/ruby/actions/runs/8416953029/job/23044511739 for an example of these errors.

eileencodes commented 6 months ago

Merging master fixes the remaining compilation errors I'm seeing locally. Happy to send a PR for that as I've already fixed the conflicts. I'm not sure how this repo prefers to sync with upstream.

Actually we need this change too, then it compiles https://github.com/mmtk/ruby/pull/64

wks commented 6 months ago

That must be a typo. We used to use #ifdef USE_MMTK, but switched to #if USE_MMTK later.