diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-21 02:17:58 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-21 02:17:58 +0000 |
commit | 8acb4044d83ecc9df81b1c9f327d5bd4325e1756 (patch) | |
tree | 40476640dc8e8148b20ab228018a262594fd1f3e /clang/lib/Headers | |
parent | dc46338e2d9c534a53369901fc8025fab9cbc9ba (diff) | |
download | bcm5719-llvm-8acb4044d83ecc9df81b1c9f327d5bd4325e1756.tar.gz bcm5719-llvm-8acb4044d83ecc9df81b1c9f327d5bd4325e1756.zip |
libstdc++'s <cstdalign> #includes <stdalign.h> and expects it to guard against
being included in C++. Don't define alignof or alignas in this case. Note that
the C++11 standard is broken in various ways here (it refers to the contents
of <stdalign.h> in C99, where that header did not exist, and doesn't mention
the alignas macro at all), but we do our best to do what it intended.
llvm-svn: 175708
Diffstat (limited to 'clang/lib/Headers')
-rw-r--r-- | clang/lib/Headers/stdalign.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Headers/stdalign.h b/clang/lib/Headers/stdalign.h index 97b18f175b9..3738d1284f9 100644 --- a/clang/lib/Headers/stdalign.h +++ b/clang/lib/Headers/stdalign.h @@ -24,8 +24,11 @@ #ifndef __STDALIGN_H #define __STDALIGN_H +#ifndef __cplusplus #define alignas _Alignas #define alignof _Alignof +#endif + #define __alignas_is_defined 1 #define __alignof_is_defined 1 |