Improve interop for win-x86 and win-x64 #52
Merged
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.
Prior to these changes, I was always deploying the
x86version ofonigwrap.dllunder Windows environments, which caused issues. For instance, under Visual Studio, running the demo project required thex64version of the library, whereas the unit test runtime required thex86version.To address this, I have made changes to the way the native library is accessed.
Firstly, I have renamed the
x86version of the library toonigwrap-x86.dll, and the x64 version toonigwrap-x64.dll. This naming convention will enable developers to identify the appropriate library version to be used based on the runtime.Secondly, I have created separate instances of Interop classes, namely
InteropWin32,InteropWin64, andInteropUnix. All these classes are wrapped under an interfaceIOnigInterop, which is initialized statically based on the platform and the runtime. This will ensure that the correct Interop class is used to load the respective native library.Fixes #51