Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup mrbsys C extension #1968

Merged
merged 4 commits into from
Jul 24, 2022
Merged

Conversation

lopopolo
Copy link
Member

  • Enable the mrbsys C extension to compile with a C++ compiler. See 24dd693 for details of these changes.
  • Remove some extraneous #includes in mrbsys/src/ext.c.
  • Update legacy call to deprecated API with the Fixnum refactor in mruby 3.1.0. See 93c51cb for details of these changes.

This PR was partially extracted from #1904 commit 9aa36b9.

Add `extern "C"` blocks when building with a C++ compiler so linkage
behaves as expected.

`class` is a keyword in C++, so rename parameters from `class` to
`klass`.

`_Bool` is a C99 keyword. Replace it with `bool` from `stdbool.h`.
With the `Fixnum` deprecation in mruby 3.1.0, `mrb_fixnum_to_str` was
renamed to `mrb_integer_to_str`. `mrb_fixnum_to_str` was retained as a
macro alias for source compatibility.

Update to the current stable function name.
@lopopolo lopopolo added A-C-API Area: C APIs for compatibility with existing interpreters. C-quality Category: Refactoring, cleanup, and quality improvements. B-mruby Backend: Implementation of artichoke-core using mruby. labels Jul 24, 2022
@lopopolo lopopolo merged commit 7bf3f03 into trunk Jul 24, 2022
@lopopolo lopopolo deleted the lopopolo/artichoke-backend-cext-c-or-c++ branch July 24, 2022 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-C-API Area: C APIs for compatibility with existing interpreters. B-mruby Backend: Implementation of artichoke-core using mruby. C-quality Category: Refactoring, cleanup, and quality improvements.
Development

Successfully merging this pull request may close these issues.

None yet

1 participant