Since cxa_exception.cpp only needs <string> for std::memset, it can instead include just <cstring>. Also, cxa_demangle.cpp doesn't actually need <algorithm>.
As a side effect of this cleanup, I'm able to build libc++abi on OpenBSD using GCC 4.2.1 if I compile against libc++'s header files. (Otherwise, libc++'s <algorithm> uses C++11 syntax that GCC 4.2.1 can't handle, and <string> includes <algorithm> too. And libstdc++ 4.2.1's headers are missing some functionality needed by libc++abi.) Not sure if that's really interesting since Clang is still needed to build libc++, but removing unnecessary includes seems worthwhile either way. Index: src/cxa_exception.cpp =================================================================== --- src/cxa_exception.cpp (revision 183600) +++ src/cxa_exception.cpp (working copy) @@ -15,7 +15,7 @@ #include <exception> // for std::terminate #include <cstdlib> // for malloc, free -#include <string> // for memset +#include <cstring> // for memset #include <pthread.h> #include "cxa_exception.hpp" Index: src/cxa_demangle.cpp =================================================================== --- src/cxa_demangle.cpp (revision 183602) +++ src/cxa_demangle.cpp (working copy) @@ -14,7 +14,6 @@ #include <ctype.h> #include <stdio.h> #include <new> -#include <algorithm> #include <assert.h> #ifdef DEBUGGING _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
