Add _LIBCPP_ABI_[ITANIUM|MICROSOFT] macros.

This patch adds a libc++ configuration macro for the ABI we
are targeting, either Itanium or Microsoft. For now we configure
for the Microsoft ABI when on Windows with a compiler that defines
_MSC_VER. However this is only temporary until Clang implements
builtin macros we can use.

llvm-svn: 291329
This commit is contained in:
Eric Fiselier 2017-01-07 02:43:58 +00:00
parent 1b97fc34a4
commit 330fe0170f
1 changed files with 9 additions and 0 deletions

View File

@ -111,6 +111,15 @@
#define _LIBCPP_COMPILER_IBM
#endif
// FIXME: ABI detection should be done via compiler builtin macros. This
// is just a placeholder until Clang implements such macros. For now assume
// that Windows compilers pretending to be MSVC++ target the microsoft ABI.
#if defined(_WIN32) && defined(_MSC_VER)
# define _LIBCPP_ABI_MICROSOFT
#else
# define _LIBCPP_ABI_ITANIUM
#endif
// Need to detect which libc we're using if we're on Linux.
#if defined(__linux__)
#include <features.h>