Work around 'unreferenced function' warnings in NO_STL builds #620
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.
Normally, as_utf8_begin et al are used in STL functions but when STL is disabled, these are only used if the target platform lacks first class support for wchar_t FILE* APIs. With some warning levels we consequently can get warnings about these functions not being referenced; this affects MSVC (when using aggressive /Wall warning setup) and MinGW (when using -Wall which should work on gcc without warnings, hence the fix).
Not defining these in the first place is difficult because of the complexity of the selection logic for open_file_wide so for now just mark these as unused. The strange (void)& syntax is needed for MSVC to not trigger another warning...
The workaround is narrowly scoped to avoid unforeseen compatibility issues.
Fixes #619.