Fix build using newest gcc(10/11) with new msys/mingw toolchains #333
+21
−17
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.
Issue
Build with newest msys/mingw toolchain using gcc/g++ compiler fails because it confuses GNU and MSVC compilers.
Option
_WIN32
is defined now and so cannot be used anymore to detect gcc as opposed to msvc starting from gcc v.10.Details
The excerpts of prepro-defines declared for gcc now ...
For windows platform (
WIN32
or_WIN32
set), the compilers can be detected using following preprocessor defines:defined(__GNUC__)
(defined(__GNUC__) && !defined(__clang__))
defined(__clang__)
defined(_MSC_VER)
Or using related
BOOST_COMP_*
defines since hyperscan already includes boost.Fix
Proposed PR fixes the issue with misdetected (msvc) compiler using
_MSC_VER
instead of_WIN32
in minimalist approach, so one is able to build hyperscan with modern gcc compilers hereafter.Note
The PR including #332 at the moment, I could rebase the branch to HEAD without 8306d2f if desired.
Toolchain and platform details