Skip to content

Commit b33a1e1

Browse files
committed
runtime: workaround GCC 4.8 libstdc++ C++11 conformance
libstdc++ included with GCC 4.8 does not define `std::max_align_t` as required by the C++11 specification. As a workaround, explicitly create the definition locally. This was fixed in GCC 4.9 and later.
1 parent 2add64f commit b33a1e1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

stdlib/public/runtime/Casting.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
#include <cstring>
4545
#include <type_traits>
4646

47+
#if defined(__GLIBCXX__) && __GLIBCXX__ < 20160726
48+
#include <stddef.h>
49+
namespace std { using ::max_align_t; }
50+
#endif
51+
4752
using namespace swift;
4853
using namespace swift::hashable_support;
4954
using namespace metadataimpl;

0 commit comments

Comments
 (0)