Conversation
jruby 10 (Ruby 4.0 mode) no longer prepends the script directory to \, so require 'Processor' in Generator.rb fails with LoadError. Add '-I.' to both jruby and MRI invocations. Also replace 'jruby -h' with 'jruby --version' because -h invokes 'cat' as a pager, which does not exist on Windows and crashes with java.io.IOException. --version prints the version string and exits 0.
The shell version already generates FixValues.h from FIX50SP2.xml but the Windows batch version was still using FIX50.xml. FIX50SP2 is the final service pack and contains all FIX 5.0 fields, so both platforms should produce identical output.
… outputs The FIX 5.0SP2 ReplaceText field collides with the ReplaceText macro defined by Windows GDI (wingdi.h). Upstream manually patched the generated .h files in commit ee190f8 but did not fix GeneratorCPP.rb, so any regeneration would silently drop the fix. Add pushReplaceText/popReplaceText helper methods to GeneratorCPP.rb that emit _MSC_VER-conditional #pragma push_macro/pop_macro guards for both FixFields.h and FixFieldNumbers.h. Previously FixFieldNumbers.h had no ReplaceText guard at all. Regenerate all affected files with the fixed scripts (jruby 10 on Windows): this also corrects several latent ordering/naming issues in the committed files caused by the old MRI/jruby Hash iteration order. Notably, QuoteAckStatus (field 1865) is now correctly separated from QuoteStatus (field 297), and fix42/QuoteAcknowledgement.h now correctly references QuoteStatus instead of QuoteAckStatus. Fixes quickfix#530
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Three small fixes that together make the C++ generation workflow work on Windows
and produce outputs that compile with MSVC.
Changes
1. Fix
spec/generate.batfor jruby 10 on Windowsjruby 10 no longer prepends the script directory to
$LOAD_PATH, sorequire "Processor"fails withLoadError. Added-I.to both jrubyand MRI invocations — consistent with
generate.shwhich already had it.Also replaced
jruby -hwithjruby --version. The-hflag usescatas a pager, which does not exist on Windows and crashes the batch script.
2. Align
spec/generate_c++.batwithgenerate_c++.shThe shell version generated
FixValues.hfromFIX50SP2.xmlbut theWindows batch version was still using
FIX50.xml. Unified onFIX50SP2.xmlso both platforms produce identical outputs.
3. Fix
GeneratorCPP.rbto emit MSVC-compatible ReplaceText guardsThe FIX 5.0SP2
ReplaceTextfield collides with theReplaceTextmacrodefined by Windows GDI (
wingdi.h). Upstream manually patched the generated.hfiles in commitee190f8but did not fix the generator, so anyregeneration silently dropped the fix.
Added
pushReplaceText/popReplaceTexthelper methods that emit_MSC_VER-conditional#pragma push_macro/pop_macroguards for bothFixFields.handFixFieldNumbers.h. PreviouslyFixFieldNumbers.hhadno ReplaceText guard at all.
Regenerated the affected files with the fixed scripts on Windows (jruby 10).
Output on Linux (MRI/jruby) is byte-identical.
Testing
spec/generate.baton Windows, confirmed no diff against committed outputcmake --build buildwith MSVC 2022, confirmed FixFields.h / FixFieldNumbers.hcompile without macro-collision errors
Related
Fixes #530