Details
Diff Detail
Event Timeline
Normally wouldn't bother with a review for something so trivial, but I know close to nothing about mingw, so I'm hoping someone can tell me if this is right. AIUI, mingw should emulate Linux, so that's what I've done here.
I, too, know pretty much nothing about mingw. but structurally, this looks fine to me.
I don't think it makes sense to use 4095, that number comes from Linux's kernel-user space ABI. MinGW targets link against the MSVC runtime, we should use _sys_nerr.
_sys_nerr seems to be the correct value but it is not available in <__config>. In my mingw setup the definition is located in <stdlib.h>, so an include needs to be added.
I'm reluctant to add yet another include into <__config>.
It includes too much stuff already.
_LIBCPP_ELAST is sparsely used, and it already drags in <errno.h>. I think we should just find a new place for it to live.
It's only used in src/system_error.cpp and src/ios.cpp so it doesn't even have to live in the headers.
Factor ELAST configuration out into src/config_elast.h.
Use _WIN32 instead of MINGW32 since this is true for MSVC as well.
Other than that - this looks good to me.
Has anyone tried this on FreeBSD?
src/system_error.cpp | ||
---|---|---|
11 ↗ | (On Diff #17200) | Please always include <__config> first. This is a convention, rather than a requirement, since the first thing that <system_error> does is include <__config> |