Cinder
Cinder copied to clipboard
Workaround for VC++ 14 bug with URLs with 260+ chars
First pass at addressing #1979. This patch resolves the original issue we had at our studio with loading URLs with long query strings (e.g. this graphql query).
A couple of notes:
- Since yesterday (03/01/2018) the bug is reported as resolved on the MS dev forums and will be included in the next VS compiler release. Because of that I limited the patch scope to
_MSC_VERand not globally toCINDER_MSW. Thoughts? - The same issue of converting the URL string to
fs::pathin order to conveniently get the filename popped up in two places:DataSourceUrlandIStreamUrl. Currently I have nearly the same snippet in both locations, but am happy to consolidate if there are any suggestions for where that could/should live. - I followed @andrewfb's suggestion to attempt a simple filename retrieval using an
rfind('/'). This works for our use-cases but I don't have a ton of insight into what other situations theDataSourceUrl::getFilePathHint()andStreamBase::getFileName()methods are used for. Any other suggestions are welcome, but I felt like a simple fix now is better than a beefier workaround later.
Happy to iterate over this.
Sorry for the delay here; this looks good to me except for the <=1912. Specifically, I just tried this with the very recently released 2017 (1913) and it's still crashing. For now maybe we just say (>=1900) and then we'll revisit when the bug is actually fixed?
As far as I understand from the linked issue, this bug will stay in std::experimental::filesystem and will only be fixed in std::filesystem (which afaik isn't released for msvc yet)
Both good points. I tested this with VS 2015's native toolsets and they still have the same issue, so might as well do a catch-all for MSW at this point instead of limiting it to versions. New commit applies to all CINDER_MSW builds.
Is this still relevant or has it been superseded by cinders move to VS2019 and std::filesystem?