Even though FileSpec attempted to handle both kinds of path syntaxes (posix and windows) on both
platforms, it relied on the llvm path library to do its work, whose behavior differed on
different platforms. This led to subtle differences in FileSpec behavior between platforms. This
replaces the pieces of the llvm library with our own implementations. The functions are simply
copied from llvm, with #ifdefs replaced by runtime checks for ePathSyntaxWindows.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Ugh. The only better way I can think of to do this would be to go into LLVM and rip out all the preprocessor defines, and compile _windows and _posix versions of every function unconditionally, and then only use the preprocessor defines to do something like:
#if defined(LLVM_ON_WIN32) #define parent_path parent_path_windows #else #define parent_path parent_path_posix #endif
But... That's a lot of effort to go through. So while this code duplication isn't really that desirable, I guess it's ok given the amount of effort of the alternative.