tp: implement regexp on Windows#171
Conversation
Implement the Regex class on Windows platform also, using std::regex instead of the unsupported POSIX regex.h, rather than leaving it broken. For android-graphics/sokatoa#5004 Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
|
Note that Perfetto upstream has done a bunch of refactoring in the Trace Processor, including what looks like a reimplementation of their regex functions on top of std::regex across the board. I doubt that it is worth trying to cherry-pick the many commits involved in that effort into our fork. |
In order to use std::regex, enable exceptions in the Windows build. This does grow trace_processor_shell.exe by about 20%, so significantly.
|
Enabled C++ exception handling in the Windows build setup, otherwise the try block did not compile. |
dfriederich
left a comment
There was a problem hiding this comment.
change worked for me on Windows after also enabling exception handling in the compiler.
In my understanding, if any code was previously throwing, it was just calling std::terminate directly. Now it will throw, not catch (except in our use of std::regex), and still end up calling std::terminate. One price to pay is the grown binary size, ca 20%.
Looks good to me @dfriederich ! Thanks for fixing that up. |
Implement the Regex class on Windows platform also, using
std::regexinstead of the unsupported POSIXregex.h, rather than leaving it broken.For android-graphics/sokatoa#5004