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

Fix compile error on MSVC 2019 #120

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix compile error on MSVC 2019 #120

wants to merge 3 commits into from

Conversation

cfis
Copy link

@cfis cfis commented May 16, 2020

MSVC does not support initializing the rb_data_type_t structure from a pointer. Error is:

ruby_wrapper.c(359): error C2099: initializer is not a constant
ruby_wrapper.c(359): error C4047: 'initializing': 'void *' differs in levels of indirection from 'int'

Fixed by moving code to pycall_init_ruby_wrapper.

…e rb_data_type_t structure from a pointer. Error is:

ruby_wrapper.c(359): error C2099: initializer is not a constant
ruby_wrapper.c(359): error C4047: 'initializing': 'void *' differs in levels of indirection from 'int'

Fixed by moving code to pycall_init_ruby_wrapper.
@mrkn
Copy link
Owner

mrkn commented May 25, 2020

@cfis Thank you for fixing this issue!

I want to apply this change only to the case of MSVC, so I'll merge this after adding some small fixes similar to the following trick:

https://github.com/ruby/ruby/pull/3024/files#diff-779cc912d1b415b1412b73ce56c7b649R56-R65

@mrkn
Copy link
Owner

mrkn commented May 25, 2020

Also, I want to add a mew CI job for testing on MSVC.
I will add some commits to this pull-request.

@cfis
Copy link
Author

cfis commented May 26, 2020

Sounds good to me. Interesting that CI has MSVC ruby builds, that's helpful to know.

@mrkn
Copy link
Owner

mrkn commented May 26, 2020

@cfis I have trouble that we don't have MSVC-built Ruby for running CI.
Before preparing MSVC-built Ruby, I want to confirm the reason why you want to use pycall.rb on MSVC-built Ruby.
Could you please explain it? Isn't mingw-version Ruby satisfy your requirements?

@cfis
Copy link
Author

cfis commented May 26, 2020

I use both mingw and mswin versions - but usually mingw ruby. However, I use the mswin version of ruby for creating/debugging extensions on Windows. Visual Studio has some really nice debugging facilities, and also let me step through Ruby itself and Python. For example, I use mswin ruby for my work on ruby-prof, libxml-ruby, etc.

Hope that helps.

@mrkn
Copy link
Owner

mrkn commented May 26, 2020

@cfis Thank you for your feedback. I understood your situation.

I'd like to let pycall.rb support of MSVC-built Ruby. For the purpose, I need to change our ruby/setup-ruby action so that we can install MSVC-built Ruby binary on the virtual environment.

Please give me some days to the preparation.

@cfis
Copy link
Author

cfis commented May 26, 2020

No problem, and thanks for looking at this. Let me know if you need any help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants