Work around broken vsnprintf implementation in mingw. #993
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes currently failing tests in XML::TestSaxEntityReference: https://gist.github.com/larskanis/7186885
It affects the currently released nokogiri-1.6.0-x86-mingw32.gem for both ruby-1.9 and ruby-2.0.
I found that the following build environments have this bug and verified that the attached patch works around it on all of them:
gcc (tdm-1) 4.5.2
- used for native builds on ruby-1.9gcc (rubenvb-4.7.2-release) 4.7.2
- used for native build on ruby-2.0 (both x86 and x64)i586-mingw32msvc-gcc (GCC) 4.2.1-sjlj (mingw32-2)
- used to cross build for ruby-1.9x86_64-w64-mingw32-gcc (rubenvb-4.7.2-release) 4.7.2
- used to cross build for ruby-2.0-x64i686-w64-mingw32-gcc (rubenvb-4.7.2-release) 4.7.2
- used to cross build for ruby-2.0-x86This issue is independent from #989, but also affects the x64-mingw32 version.
All nokogiri tests pass when the gem is built with any of the above environments and when using this PR together with #989. Verified with Ruby-x64 2.0.0-p0, Ruby-x86 2.0.0-p0 and Ruby-x86 1.9.3-p392 installed per RubyInstaller.
The buildin vasprintf() function is also used on Solaris, which I'm not able to test. But the given workaround should work on any platform that implements vsnprintf() according to C99.