Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@cfis
Copy link
Contributor

@cfis cfis commented Apr 20, 2023

This MR includes several small changes that enable MSVC 2022 to compile the libtest library in the spec/fixtures directory. With these changes, all tests pass on MSVC.

Note that the compile.rb file on Windows only works with mingw, so it would have to change to support MSVC. I assume that isn't important, but if we wanted to go down that route at some point we could either:

  • add a Makefile for nmake like mkmf does
  • or likely better, and way more modern, add a simple CMakelists.text file and use cmake

cfis added 3 commits April 20, 2023 10:24
…W when compiling with MSVC 22. These apis take a widechar - LPCWSTR. Thus these tests fail because Windows considers the pipe names to be invalid. Thus switch to the Ansi versions.
…Instead, the function pointers must be a typdef. For what its worth, see https://stackoverflow.com/a/37114318.
@larskanis larskanis merged commit 98cce6a into ffi:master Apr 20, 2023
@larskanis
Copy link
Member

Although I have less experience with cmake, I prefer a cross platform solution over separate branches. The test environments can usually be changed easily, so that introducing cmake should be simple. In addition the GitHub CI has mswin binaries for testing. Feel free to open a PR.

@larskanis
Copy link
Member

larskanis commented Aug 2, 2024

@cfis I just added a CI run on Github Actions for ffi on MSVC / MSWIN in #1092. For now libtest.dll is built with GNU tools, but the rest is running on MSVC compiled binaries. CI looks like so: https://github.com/ffi/ffi/actions/runs/10220222201/job/28280151493

libffi is taken from the preinstalled system libraries of ruby/setup-ruby . The embedded libffi is not tested so far.

@cfis
Copy link
Contributor Author

cfis commented Aug 2, 2024

Awesome - thanks!

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.

2 participants