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

vm capi: more MRI C API enum types compatibility. #3141

Merged
merged 1 commit into from
Sep 28, 2014

Conversation

cosmo0920
Copy link
Contributor

  • add RUBY_ prefix for T_XXX types
  • add backward compatibility for T_XXX types.

Currently, MRI provides RUBY_T_XXX forms of enum types in C extension.
But, Rubinius does not provide these of types.
So, it causes gem installation error, when gem uses RUBY_T_XXX in C extension.

e.g. glib2 gem:

rbglib_utils.c: In function 'rg_s_parse_debug_string':
rbglib_utils.c:250:22: error: 'RUBY_T_HASH' undeclared (first use in this function)
     Check_Type(keys, RUBY_T_HASH);

EDIT: MRI provides both T_XXX and RUBY_T_XXX enum types in C API: https://github.com/ruby/ruby/blob/4817ab23b31c2c71682c3d54e9da45f53fa7f154/include/ruby/ruby.h#L424-L482

* add RUBY_ prefix for T_XXX types
* add backward compatibility for T_XXX types.

Currently, MRI provides `RUBY_T_XXX` forms of enum types in C extension.
But, Rubinius does not provide these of types.
So, it causes gem installation error, when gem uses `RUBY_T_XXX` in C extension.

e.g. glib2 gem:

```log
rbglib_utils.c: In function 'rg_s_parse_debug_string':
rbglib_utils.c:250:22: error: 'RUBY_T_HASH' undeclared (first use in this function)
     Check_Type(keys, RUBY_T_HASH);
```
@yorickpeterse yorickpeterse added the C-API Compatibility Function and feature compatibility with the MRI C-API label Sep 27, 2014
yorickpeterse pushed a commit that referenced this pull request Sep 28, 2014
vm capi: more MRI C API enum types compatibility.
@yorickpeterse yorickpeterse merged commit 2a09134 into rubinius:master Sep 28, 2014
@cosmo0920
Copy link
Contributor Author

Thank you for merging!

@cosmo0920 cosmo0920 deleted the mri-capi-enum-types branch September 28, 2014 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-API Compatibility Function and feature compatibility with the MRI C-API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants